File tree Expand file tree Collapse file tree 3 files changed +11
-5
lines changed
LocalDataStore/OfflineQueryLogic Expand file tree Collapse file tree 3 files changed +11
-5
lines changed Original file line number Diff line number Diff line change @@ -145,7 +145,7 @@ - (id)valueForContainer:(id)container
145145 } else if ([key isEqualToString: @" updatedAt" ] || [key isEqualToString: @" _updated_at" ]) {
146146 return object.updatedAt ;
147147 } else {
148- return object[key];
148+ return key ? object[key] : nil ;
149149 }
150150 } else if ([container isKindOfClass: [NSDictionary class ]]) {
151151 return ((NSDictionary *)container)[key];
Original file line number Diff line number Diff line change @@ -94,7 +94,9 @@ - (instancetype)initWithClass:(Class)kls name:(NSString *)propertyName
9494 propertySetter = [NSString stringWithFormat: @" set%@ :" , stringByCapitalizingFirstCharacter (_name)];
9595 }
9696
97- _setterSelector = NSSelectorFromString (propertySetter);
97+ if (propertySetter != nil ) {
98+ _setterSelector = NSSelectorFromString (propertySetter);
99+ }
98100
99101 if (_associationType == PFPropertyInfoAssociationTypeDefault) {
100102 BOOL isCopy = safeStringWithPropertyAttributeValue (objcProperty, " C" ) != nil ;
Original file line number Diff line number Diff line change @@ -776,7 +776,9 @@ + (id)_objectFromDictionary:(NSDictionary *)dictionary
776776 defaultClassName: defaultClassName
777777 completeData: (selectedKeys == nil )
778778 decoder: [PFDecoder objectDecoder ]];
779- [result->_availableKeys addObjectsFromArray: selectedKeys];
779+ if (selectedKeys) {
780+ [result->_availableKeys addObjectsFromArray: selectedKeys];
781+ }
780782 return result;
781783}
782784
@@ -964,7 +966,7 @@ - (void)mergeFromRESTDictionary:(NSDictionary *)object withDecoder:(PFDecoder *)
964966 }
965967
966968 PFOperationSet *localOperationSet = [self unsavedChanges ];
967- if (localOperationSet.updatedAt != nil &&
969+ if (localOperationSet.updatedAt != nil && remoteOperationSet. updatedAt != nil &&
968970 [localOperationSet.updatedAt compare: remoteOperationSet.updatedAt] != NSOrderedAscending) {
969971 [localOperationSet mergeOperationSet: remoteOperationSet];
970972 } else {
@@ -1304,7 +1306,9 @@ - (void)_mergeFromServerWithResult:(NSDictionary *)result decoder:(PFDecoder *)d
13041306 state.updatedAt = state.createdAt ;
13051307 }
13061308 }];
1307- [_availableKeys addObjectsFromArray: result.allKeys];
1309+ if (result.allKeys ) {
1310+ [_availableKeys addObjectsFromArray: result.allKeys];
1311+ }
13081312
13091313 dirty = NO ;
13101314 }
You can’t perform that action at this time.
0 commit comments