From 8425292eb4447c4e20ca1309d90b1fabd5454422 Mon Sep 17 00:00:00 2001 From: David Vacca Date: Fri, 18 Oct 2019 09:07:39 -0700 Subject: [PATCH] Report Redbox error when a component is not implemented Summary: This diff ensures that a redbox is reported when a component is not registered in Fabric. Changelog: Ensure a redbox is reported when components are not registered in Fabric. Reviewed By: shergin Differential Revision: D17970793 fbshipit-source-id: 7afd7e6b0b9c0ff6d2bd475dbf6979d83fec093c --- .../fabric/uimanager/ComponentDescriptorRegistry.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/ReactCommon/fabric/uimanager/ComponentDescriptorRegistry.cpp b/ReactCommon/fabric/uimanager/ComponentDescriptorRegistry.cpp index a0eee148829..64a36c444ad 100644 --- a/ReactCommon/fabric/uimanager/ComponentDescriptorRegistry.cpp +++ b/ReactCommon/fabric/uimanager/ComponentDescriptorRegistry.cpp @@ -130,7 +130,13 @@ ComponentDescriptor const &ComponentDescriptorRegistry::at( auto it = _registryByName.find(unifiedComponentName); if (it == _registryByName.end()) { - assert(providerRegistry_); + // TODO: T54849676 Refactor this condition when RN Fabric Android starts + // using ComponentDescriptorProviderRegistry class + if (!providerRegistry_) { + throw std::invalid_argument( + ("Unable to find componentDescriptor for " + unifiedComponentName) + .c_str()); + } mutex_.unlock_shared(); providerRegistry_->request(unifiedComponentName.c_str());