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
145
145
} else if ([key isEqualToString: @" updatedAt" ] || [key isEqualToString: @" _updated_at" ]) {
146
146
return object.updatedAt ;
147
147
} else {
148
- return object[key];
148
+ return key ? object[key] : nil ;
149
149
}
150
150
} else if ([container isKindOfClass: [NSDictionary class ]]) {
151
151
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
94
94
propertySetter = [NSString stringWithFormat: @" set%@ :" , stringByCapitalizingFirstCharacter (_name)];
95
95
}
96
96
97
- _setterSelector = NSSelectorFromString (propertySetter);
97
+ if (propertySetter != nil ) {
98
+ _setterSelector = NSSelectorFromString (propertySetter);
99
+ }
98
100
99
101
if (_associationType == PFPropertyInfoAssociationTypeDefault) {
100
102
BOOL isCopy = safeStringWithPropertyAttributeValue (objcProperty, " C" ) != nil ;
Original file line number Diff line number Diff line change @@ -776,7 +776,9 @@ + (id)_objectFromDictionary:(NSDictionary *)dictionary
776
776
defaultClassName: defaultClassName
777
777
completeData: (selectedKeys == nil )
778
778
decoder: [PFDecoder objectDecoder ]];
779
- [result->_availableKeys addObjectsFromArray: selectedKeys];
779
+ if (selectedKeys) {
780
+ [result->_availableKeys addObjectsFromArray: selectedKeys];
781
+ }
780
782
return result;
781
783
}
782
784
@@ -964,7 +966,7 @@ - (void)mergeFromRESTDictionary:(NSDictionary *)object withDecoder:(PFDecoder *)
964
966
}
965
967
966
968
PFOperationSet *localOperationSet = [self unsavedChanges ];
967
- if (localOperationSet.updatedAt != nil &&
969
+ if (localOperationSet.updatedAt != nil && remoteOperationSet. updatedAt != nil &&
968
970
[localOperationSet.updatedAt compare: remoteOperationSet.updatedAt] != NSOrderedAscending) {
969
971
[localOperationSet mergeOperationSet: remoteOperationSet];
970
972
} else {
@@ -1304,7 +1306,9 @@ - (void)_mergeFromServerWithResult:(NSDictionary *)result decoder:(PFDecoder *)d
1304
1306
state.updatedAt = state.createdAt ;
1305
1307
}
1306
1308
}];
1307
- [_availableKeys addObjectsFromArray: result.allKeys];
1309
+ if (result.allKeys ) {
1310
+ [_availableKeys addObjectsFromArray: result.allKeys];
1311
+ }
1308
1312
1309
1313
dirty = NO ;
1310
1314
}
You can’t perform that action at this time.
0 commit comments