Check for nullptr when accessing isInspectable method

Reviewed By: javache

Differential Revision: D6785733

fbshipit-source-id: 1bbb884746e671124b7d2d950a3419ea33d70522
This commit is contained in:
Alex Dvornikov 2018-01-23 09:56:21 -08:00 committed by Facebook Github Bot
parent 4f6c157250
commit 70d23e82ad
1 changed files with 4 additions and 3 deletions

View File

@ -191,11 +191,12 @@ struct RCTInstanceCallback : public InstanceCallback {
- (JSGlobalContextRef)jsContextRef
{
return (JSGlobalContextRef)(self->_reactInstance ? self->_reactInstance->getJavaScriptContext() : nullptr);
return (JSGlobalContextRef)(_reactInstance ? _reactInstance->getJavaScriptContext() : nullptr);
}
- (BOOL)isInspectable {
return self->_reactInstance->isInspectable();
- (BOOL)isInspectable
{
return _reactInstance ? _reactInstance->isInspectable() : NO;
}
- (instancetype)initWithParentBridge:(RCTBridge *)bridge