Skip to content
This repository was archived by the owner on Feb 2, 2023. It is now read-only.

Commit 64ee8db

Browse files
haritowaAdlai Holler
authored andcommitted
[ASDisplayNode Deallocation] Fix for crash when certain types are used as instance variables. (#2803)
* Fix #2802 * Change nil to NULL
1 parent f7a0ac9 commit 64ee8db

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

AsyncDisplayKit/ASDisplayNode.mm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -542,7 +542,7 @@ - (void)_scheduleIvarsForMainDeallocation
542542
Ivar ivar = allMyIvars[i];
543543
const char *type = ivar_getTypeEncoding(ivar);
544544

545-
if (strcmp(type, @encode(id)) == 0) {
545+
if (type != NULL && strcmp(type, @encode(id)) == 0) {
546546
// If it's `id` we have to include it just in case.
547547
resultIvars[resultCount] = ivar;
548548
resultCount += 1;

AsyncDisplayKit/Private/ASInternalHelpers.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ BOOL ASClassRequiresMainThreadDeallocation(Class class)
107107
Class _Nullable ASGetClassFromType(const char *type)
108108
{
109109
// Class types all start with @"
110-
if (strncmp(type, "@\"", 2) != 0) {
110+
if (type == NULL || strncmp(type, "@\"", 2) != 0) {
111111
return nil;
112112
}
113113

0 commit comments

Comments
 (0)