mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-24 07:05:35 +00:00
[ASDisplayNode Deallocation] Fix for crash when certain types are used as instance variables. (#2803)
* Fix https://github.com/facebook/AsyncDisplayKit/issues/2802 * Change nil to NULL
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user