summaryrefslogtreecommitdiff
path: root/src/inspector_agent.cc
diff options
context:
space:
mode:
authorNikolai Vavilov <vvnicholas@gmail.com>2017-06-04 20:15:27 +0300
committerNikolai Vavilov <vvnicholas@gmail.com>2017-06-09 14:28:17 +0300
commit9991e27ac8f0560fecb507e6ce6e52b1e36dcdd0 (patch)
tree0569b23a87807ae085c87788e497e5303d46f94d /src/inspector_agent.cc
parent8208fdae2be11ff3c1126dc669ca63b6d08b0cb1 (diff)
downloadandroid-node-v8-9991e27ac8f0560fecb507e6ce6e52b1e36dcdd0.tar.gz
android-node-v8-9991e27ac8f0560fecb507e6ce6e52b1e36dcdd0.tar.bz2
android-node-v8-9991e27ac8f0560fecb507e6ce6e52b1e36dcdd0.zip
inspector: fix crash on exception
Fixes: https://github.com/nodejs/node/issues/13438 PR-URL: https://github.com/nodejs/node/pull/13455 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Refael Ackermann <refack@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Timothy Gu <timothygu99@gmail.com>
Diffstat (limited to 'src/inspector_agent.cc')
-rw-r--r--src/inspector_agent.cc4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/inspector_agent.cc b/src/inspector_agent.cc
index 948719ed70..f1acfa64b4 100644
--- a/src/inspector_agent.cc
+++ b/src/inspector_agent.cc
@@ -371,7 +371,9 @@ void CallAndPauseOnStart(
v8::MaybeLocal<v8::Value> retval =
args[0].As<v8::Function>()->Call(env->context(), args[1],
call_args.size(), call_args.data());
- args.GetReturnValue().Set(retval.ToLocalChecked());
+ if (!retval.IsEmpty()) {
+ args.GetReturnValue().Set(retval.ToLocalChecked());
+ }
}
// Used in NodeInspectorClient::currentTimeMS() below.