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

Unified Diff: Source/core/dom/DOMDataView.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
« no previous file with comments | « Source/bindings/tests/results/core/V8TestObject.cpp ('k') | Source/core/dom/DOMTypedArray.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/dom/DOMDataView.cpp
diff --git a/Source/core/dom/DOMDataView.cpp b/Source/core/dom/DOMDataView.cpp
index 1092e10a98a93fd47442e9d451466807e9f63f29..617554f25de71809d97fe09a86ec9ee6f49d05a4 100644
--- a/Source/core/dom/DOMDataView.cpp
+++ b/Source/core/dom/DOMDataView.cpp
@@ -29,6 +29,8 @@ v8::Local<v8::Object> DOMDataView::wrap(v8::Isolate* isolate, v8::Local<v8::Obje
const WrapperTypeInfo* wrapperTypeInfo = this->wrapperTypeInfo();
v8::Local<v8::Value> v8Buffer = toV8(buffer(), creationContext, isolate);
+ if (v8Buffer.IsEmpty())
+ return v8::Handle<v8::Object>();
ASSERT(v8Buffer->IsArrayBuffer());
v8::Local<v8::Object> wrapper = v8::DataView::New(v8Buffer.As<v8::ArrayBuffer>(), byteOffset(), byteLength());
« no previous file with comments | « Source/bindings/tests/results/core/V8TestObject.cpp ('k') | Source/core/dom/DOMTypedArray.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698