mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
TM iOS: Verify that module class conforms to RCTTurboModule before instantiating
Summary: At times, the lookup logic may find a class that's not compliant with RCTTurboModule. If so, it shouldn't be instantiated, and we assume the module doesn't exist. Reviewed By: JoshuaGross, RSNara Differential Revision: D13979004 fbshipit-source-id: ac1fa9cc456715cddd101fff13f5a41f9528a74e
This commit is contained in:
committed by
Facebook Github Bot
parent
3e9f9cfe47
commit
94925d5eb7
@@ -176,7 +176,7 @@ static Class getFallbackClassFromName(const char *name) {
|
||||
moduleClass = getFallbackClassFromName(moduleName);
|
||||
}
|
||||
|
||||
if (!moduleClass) {
|
||||
if (![moduleClass conformsToProtocol:@protocol(RCTTurboModule)]) {
|
||||
return nil;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user