From 94925d5eb7937f4cf63b6dc6cd9830f9a62fc3b2 Mon Sep 17 00:00:00 2001 From: Kevin Gozali Date: Wed, 6 Feb 2019 15:58:48 -0800 Subject: [PATCH] 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 --- .../turbomodule/core/platform/ios/RCTTurboModuleManager.mm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ReactCommon/turbomodule/core/platform/ios/RCTTurboModuleManager.mm b/ReactCommon/turbomodule/core/platform/ios/RCTTurboModuleManager.mm index a44146ab4e0..a5fefa050c7 100644 --- a/ReactCommon/turbomodule/core/platform/ios/RCTTurboModuleManager.mm +++ b/ReactCommon/turbomodule/core/platform/ios/RCTTurboModuleManager.mm @@ -176,7 +176,7 @@ static Class getFallbackClassFromName(const char *name) { moduleClass = getFallbackClassFromName(moduleName); } - if (!moduleClass) { + if (![moduleClass conformsToProtocol:@protocol(RCTTurboModule)]) { return nil; }