Skip to content

Commit d22a765

Browse files
committed
Fixes analyzer issues
1 parent 6abc694 commit d22a765

File tree

9 files changed

+16
-10
lines changed

9 files changed

+16
-10
lines changed

Parse/Parse/Internal/Commands/PFRESTQueryCommand.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ + (nullable NSDictionary *)findCommandParametersWithOrder:(NSString *)order
202202
parameters[@"where"] = whereData;
203203
}
204204
if (encodingFailed && encodingError) {
205-
*error = encodingError;
205+
PFSetError(error, encodingError);
206206
return nil;
207207
}
208208

Parse/Parse/Internal/KeyValueCache/PFKeyValueCache.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ NS_ASSUME_NONNULL_BEGIN
3535
#pragma mark - Getting
3636
///--------------------------------------
3737

38-
- (NSString *)objectForKey:(NSString *)key maxAge:(NSTimeInterval)age;
38+
- (nullable NSString *)objectForKey:(NSString *)key maxAge:(NSTimeInterval)age;
3939

4040
///--------------------------------------
4141
#pragma mark - Removing

Parse/Parse/Internal/Object/PFObjectPrivate.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@
8585
@return Current object state.
8686
*/
8787
@property (nonatomic, copy) PFObjectState *_state;
88-
@property (nonatomic, copy) NSMutableSet *_availableKeys;
88+
@property (nonatomic, retain) NSMutableSet *_availableKeys;
8989

9090
- (instancetype)initWithObjectState:(PFObjectState *)state;
9191
+ (instancetype)objectWithClassName:(NSString *)className

Parse/Parse/Internal/Object/State/PFObjectState.m

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
* of patent rights can be found in the PATENTS file in the same directory.
88
*/
99

10+
#import "PFAssert.h"
1011
#import "PFObjectState.h"
1112
#import "PFObjectState_Private.h"
1213

@@ -129,7 +130,7 @@ - (NSDictionary *)dictionaryRepresentationWithObjectEncoder:(PFEncoder *)objectE
129130
result[key] = encoded;
130131
}];
131132
if (failed && encodingError) {
132-
*error = encodingError;
133+
PFSetError(error, encodingError);
133134
return nil;
134135
}
135136
return [result copy];

Parse/Parse/Internal/Object/Utilities/PFObjectUtilities.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,9 @@ NS_ASSUME_NONNULL_BEGIN
2020
#pragma mark - Operations
2121
///--------------------------------------
2222

23-
+ (id)newValueByApplyingFieldOperation:(PFFieldOperation *)operation
24-
toDictionary:(NSMutableDictionary *)dictionary
25-
forKey:(NSString *)key;
23+
+ (nullable id)newValueByApplyingFieldOperation:(PFFieldOperation *)operation
24+
toDictionary:(NSMutableDictionary *)dictionary
25+
forKey:(NSString *)key;
2626
+ (void)applyOperationSet:(PFOperationSet *)operationSet toDictionary:(NSMutableDictionary *)dictionary;
2727

2828
///--------------------------------------

Parse/Parse/Internal/PFAssert.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,11 @@ if (!(condition) && error && *error == nil) { \
8181
return rval;\
8282
}
8383

84+
#define PFSetError(errorPointer, error) \
85+
if (errorPointer) {\
86+
*errorPointer = error;\
87+
}
88+
8489
/*
8590
Returns the passed value if the condition isn't met and the *error is set
8691
*/

Parse/Parse/Internal/Query/Controller/PFQueryController.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ NS_ASSUME_NONNULL_BEGIN
7878
#pragma mark - Caching
7979
///--------------------------------------
8080

81-
- (NSString *)cacheKeyForQueryState:(PFQueryState *)queryState sessionToken:(nullable NSString *)sessionToken;
81+
- (nullable NSString *)cacheKeyForQueryState:(PFQueryState *)queryState sessionToken:(nullable NSString *)sessionToken;
8282
- (BOOL)hasCachedResultForQueryState:(PFQueryState *)queryState sessionToken:(nullable NSString *)sessionToken;
8383

8484
- (void)clearCachedResultForQueryState:(PFQueryState *)queryState sessionToken:(nullable NSString *)sessionToken;

Parse/Parse/PFEncoder.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ - (id)encodeObject:(id)object error:(NSError * __autoreleasing *) error {
107107
}
108108
}];
109109
if (encodingFailed) {
110-
*error = encodingError;
110+
PFSetError(error, encodingError);
111111
return nil;
112112
}
113113
return dict;

Parse/Parse/PFObject.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,7 @@ + (BOOL)collectDirtyChildren:(id)node
245245
}
246246
}];
247247
if (wasStopped) {
248-
*error = localError;
248+
PFSetError(error, localError);
249249
return NO;
250250
}
251251
} else if ([node isKindOfClass:[PFACL class]]) {

0 commit comments

Comments
 (0)