mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
Nullcheck before dispatching view command
Summary: Changelog: [internal] `shadowNodeFromValue` can return nullptr. Let's make sure it returns valid value before dispatching command. Reviewed By: JoshuaGross Differential Revision: D26605350 fbshipit-source-id: eb9a0347c95ba07fd7e9b7ddeca7e6d6011f50ad
This commit is contained in:
committed by
Facebook GitHub Bot
parent
e67811e7a6
commit
f7eecc68cb
@@ -534,11 +534,13 @@ jsi::Value UIManagerBinding::get(
|
||||
jsi::Value const &thisValue,
|
||||
jsi::Value const *arguments,
|
||||
size_t count) noexcept -> jsi::Value {
|
||||
uiManager->dispatchCommand(
|
||||
shadowNodeFromValue(runtime, arguments[0]),
|
||||
stringFromValue(runtime, arguments[1]),
|
||||
commandArgsFromValue(runtime, arguments[2]));
|
||||
|
||||
auto shadowNode = shadowNodeFromValue(runtime, arguments[0]);
|
||||
if (shadowNode) {
|
||||
uiManager->dispatchCommand(
|
||||
shadowNodeFromValue(runtime, arguments[0]),
|
||||
stringFromValue(runtime, arguments[1]),
|
||||
commandArgsFromValue(runtime, arguments[2]));
|
||||
}
|
||||
return jsi::Value::undefined();
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user