Commit 2e5dd217 authored by kozyatinskiy's avatar kozyatinskiy Committed by Commit bot

[inspector] fixed injected-script-host crash

It's possible to get undefined as a result of Object.getOwnPropertyDescriptor. We should be ready for this.

BUG=chromium:707670
R=alph@chromium.org

Review-Url: https://codereview.chromium.org/2801763002
Cr-Commit-Position: refs/heads/master@{#44532}
parent e00dd8eb
...@@ -403,7 +403,9 @@ InjectedScript.prototype = { ...@@ -403,7 +403,9 @@ InjectedScript.prototype = {
var descriptor; var descriptor;
try { try {
descriptor = InjectedScriptHost.getOwnPropertyDescriptor(o, property); descriptor = InjectedScriptHost.getOwnPropertyDescriptor(o, property);
InjectedScriptHost.nullifyPrototype(descriptor); if (descriptor) {
InjectedScriptHost.nullifyPrototype(descriptor);
}
var isAccessorProperty = descriptor && ("get" in descriptor || "set" in descriptor); var isAccessorProperty = descriptor && ("get" in descriptor || "set" in descriptor);
if (accessorPropertiesOnly && !isAccessorProperty) if (accessorPropertiesOnly && !isAccessorProperty)
continue; continue;
......
...@@ -105,7 +105,9 @@ v8::Local<v8::Object> V8InjectedScriptHost::create( ...@@ -105,7 +105,9 @@ v8::Local<v8::Object> V8InjectedScriptHost::create(
void V8InjectedScriptHost::nullifyPrototypeCallback( void V8InjectedScriptHost::nullifyPrototypeCallback(
const v8::FunctionCallbackInfo<v8::Value>& info) { const v8::FunctionCallbackInfo<v8::Value>& info) {
CHECK(info.Length() == 1 && info[0]->IsObject()); CHECK(info.Length() == 1);
DCHECK(info[0]->IsObject());
if (!info[0]->IsObject()) return;
v8::Isolate* isolate = info.GetIsolate(); v8::Isolate* isolate = info.GetIsolate();
info[0] info[0]
.As<v8::Object>() .As<v8::Object>()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment