Skip to content

Commit

Permalink
fix attempting to create a dictionary with nil values re #38
Browse files Browse the repository at this point in the history
  • Loading branch information
dognotdog committed Sep 30, 2020
1 parent 2d9b32b commit f3d32aa
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions PtpWebcamDalPlugin/PtpCamera.m
Original file line number Diff line number Diff line change
Expand Up @@ -1133,8 +1133,8 @@ - (void) parsePtpPropertyDescription: (NSData*) data

NSNumber* formFlag = [self parsePtpUint8: valuesData remainingData: &valuesData];


if (PTP_DATATYPE_INVALID == dataType)
// if we couldn't parse the values, don't continue
if (!value || !defaultValue)
return;


Expand Down Expand Up @@ -1183,9 +1183,7 @@ - (void) parsePtpPropertyDescription: (NSData*) data

NSDictionary* oldInfo = self.ptpPropertyInfos[@(property)];
@synchronized (self) {
NSMutableDictionary* dict = self.ptpPropertyInfos.mutableCopy;
dict[@(property)] = info;
self.ptpPropertyInfos = dict;
self.ptpPropertyInfos = [self.ptpPropertyInfos dictionaryBySettingObject: info forKey: @(property)];
}

[self receivedProperty: info oldProperty: oldInfo withId: @(property)];
Expand Down

0 comments on commit f3d32aa

Please sign in to comment.