Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(329)

Unified Diff: Source/bindings/core/v8/custom/V8PopStateEventCustom.cpp

Issue 1100223003: bindings: Add empty checks for toV8() (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: rebase Created 5 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: Source/bindings/core/v8/custom/V8PopStateEventCustom.cpp
diff --git a/Source/bindings/core/v8/custom/V8PopStateEventCustom.cpp b/Source/bindings/core/v8/custom/V8PopStateEventCustom.cpp
index f8d613991b348c3662dd06d5a549913117aae084..ddd2259623ad04d4083bada7126cf56746935d6c 100644
--- a/Source/bindings/core/v8/custom/V8PopStateEventCustom.cpp
+++ b/Source/bindings/core/v8/custom/V8PopStateEventCustom.cpp
@@ -83,7 +83,10 @@ void V8PopStateEvent::stateAttributeGetterCustom(const v8::PropertyCallbackInfo<
bool isSameState = history->isSameAsCurrentState(event->serializedState());
if (isSameState) {
- v8::Local<v8::Object> v8History = toV8(history, info.Holder(), info.GetIsolate()).As<v8::Object>();
+ v8::Local<v8::Value> v8HistoryValue = toV8(history, info.Holder(), info.GetIsolate());
+ if (v8HistoryValue.IsEmpty())
+ return;
+ v8::Local<v8::Object> v8History = v8HistoryValue.As<v8::Object>();
if (!history->stateChanged()) {
result = V8HiddenValue::getHiddenValue(info.GetIsolate(), v8History, V8HiddenValue::state(info.GetIsolate()));
if (!result.IsEmpty()) {
« no previous file with comments | « Source/bindings/core/v8/WindowProxy.cpp ('k') | Source/bindings/modules/v8/ScriptValueSerializerForModules.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698