fix: prevent crash in ListValue v8 converter when conversion fails (#22753)

This commit is contained in:
Samuel Attard 2020-03-18 13:59:34 -07:00 committed by GitHub
parent 232ca8af39
commit f3fd40c221
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -59,7 +59,7 @@ bool Converter<base::ListValue>::FromV8(v8::Isolate* isolate,
electron::V8ValueConverter converter;
std::unique_ptr<base::Value> value(
converter.FromV8Value(val, isolate->GetCurrentContext()));
if (value->is_list()) {
if (value && value->is_list()) {
out->Swap(static_cast<base::ListValue*>(value.get()));
return true;
} else {