TM iOS: guard against nullptr in module lookup
Summary: Just tightened up the lookup logic to guard against nullptr. Reviewed By: RSNara Differential Revision: D13948001 fbshipit-source-id: 55bf46619712e60e195ea12f2b8eb799f80a3bbe
This commit is contained in:
parent
aa39cb6d9f
commit
8ae185280d
|
@ -124,6 +124,7 @@ static Class getFallbackClassFromName(const char *name) {
|
|||
// allow it to do so.
|
||||
if ([module respondsToSelector:@selector(getTurboModuleWithJsInvoker:)]) {
|
||||
auto turboModule = [module getTurboModuleWithJsInvoker:_jsInvoker];
|
||||
assert(turboModule != nullptr);
|
||||
_turboModuleCache.insert({moduleName, turboModule});
|
||||
return turboModule;
|
||||
}
|
||||
|
@ -144,7 +145,9 @@ static Class getFallbackClassFromName(const char *name) {
|
|||
* Step 2d: Return an exact sub-class of ObjC TurboModule
|
||||
*/
|
||||
auto turboModule = [_delegate getTurboModule:moduleName instance:module jsInvoker:_jsInvoker];
|
||||
_turboModuleCache.insert({moduleName, turboModule});
|
||||
if (turboModule != nullptr) {
|
||||
_turboModuleCache.insert({moduleName, turboModule});
|
||||
}
|
||||
return turboModule;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue