Skip to content

Commit

Permalink
Fix static-analyzer error: +[DDLog registeredClasses] returning nil
Browse files Browse the repository at this point in the history
+[DDLog registeredClasses] should return empty array rather than nil.
Is declared between NS_ASSUME_NONNULL_BEGIN and NS_ASSUME_NONNULL_END
  • Loading branch information
DD-P committed Jan 9, 2017
1 parent 04416a1 commit 3a4383a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Classes/DDLog.m
Expand Up @@ -609,7 +609,7 @@ + (NSArray *)registeredClasses {

classes = numClasses ? (Class *)malloc(sizeof(Class) * bufferSize) : NULL;
if (classes == NULL) {
return nil; //no memory or classes?
return @[]; //no memory or classes?
}

numClasses = (NSUInteger)MAX(objc_getClassList(classes, (int)bufferSize),0);
Expand Down

0 comments on commit 3a4383a

Please sign in to comment.