add error logs for nil moduleRegistry

Summary:
Changelog: [Internal]

for the last 6 months or so, we've been getting this task where the moduleRegistry in RCTDeviceInfo is nil. in this change, i add some logs to see what might be setting this to nil.

 in all honestly, i don't really think this is happening, but it would be good to verify.

Reviewed By: sshic

Differential Revision: D34908902

fbshipit-source-id: d375285467a87453605ba0fecfc124bc3bff6e63
This commit is contained in:
Phillip Pan
2022-03-16 21:03:36 -07:00
committed by Facebook GitHub Bot
parent bc53279a56
commit 9b4bb54fdf
+8
View File
@@ -69,6 +69,14 @@ RCT_EXPORT_MODULE()
object:nil];
}
- (void)setModuleRegistry:(RCTModuleRegistry *)moduleRegistry
{
if (!moduleRegistry) {
RCTAssert(false, @"moduleRegistry should not be nil, _moduleRegistry is nil: %d", _moduleRegistry == nil);
}
_moduleRegistry = moduleRegistry;
}
static BOOL RCTIsIPhoneX()
{
static BOOL isIPhoneX = NO;