diff --git a/ReactAndroid/src/main/java/com/facebook/react/bridge/JavaScriptModuleRegistry.java b/ReactAndroid/src/main/java/com/facebook/react/bridge/JavaScriptModuleRegistry.java index 257321b32..8dd2fd954 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/bridge/JavaScriptModuleRegistry.java +++ b/ReactAndroid/src/main/java/com/facebook/react/bridge/JavaScriptModuleRegistry.java @@ -59,10 +59,11 @@ public class JavaScriptModuleRegistry { return (T) module; } - JavaScriptModuleRegistration registration = - Assertions.assertNotNull( - mModuleRegistrations.get(moduleInterface), - "JS module " + moduleInterface.getSimpleName() + " hasn't been registered!"); + JavaScriptModuleRegistration registration = mModuleRegistrations.get(moduleInterface); + if (registration == null) { + throw new IllegalArgumentException( + "JS module " + moduleInterface.getSimpleName() + " hasn't been registered!"); + } JavaScriptModule interfaceProxy = (JavaScriptModule) Proxy.newProxyInstance( moduleInterface.getClassLoader(), new Class[]{moduleInterface},