diff --git a/AsyncDisplayKit/ASDisplayNode.mm b/AsyncDisplayKit/ASDisplayNode.mm index 435e40ba92..215c4dce8f 100644 --- a/AsyncDisplayKit/ASDisplayNode.mm +++ b/AsyncDisplayKit/ASDisplayNode.mm @@ -542,7 +542,7 @@ static ASDisplayNodeMethodOverrides GetASDisplayNodeMethodOverrides(Class c) Ivar ivar = allMyIvars[i]; const char *type = ivar_getTypeEncoding(ivar); - if (strcmp(type, @encode(id)) == 0) { + if (type != NULL && strcmp(type, @encode(id)) == 0) { // If it's `id` we have to include it just in case. resultIvars[resultCount] = ivar; resultCount += 1; diff --git a/AsyncDisplayKit/Private/ASInternalHelpers.m b/AsyncDisplayKit/Private/ASInternalHelpers.m index 4a78f14d65..d57f8ba35c 100644 --- a/AsyncDisplayKit/Private/ASInternalHelpers.m +++ b/AsyncDisplayKit/Private/ASInternalHelpers.m @@ -107,7 +107,7 @@ BOOL ASClassRequiresMainThreadDeallocation(Class class) Class _Nullable ASGetClassFromType(const char *type) { // Class types all start with @" - if (strncmp(type, "@\"", 2) != 0) { + if (type == NULL || strncmp(type, "@\"", 2) != 0) { return nil; }