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

Unified Diff: Source/core/dom/DOMTypedArray.cpp

Issue 1100223003: bindings: Add empty checks for toV8() (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 8 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/core/dom/DOMTypedArray.cpp
diff --git a/Source/core/dom/DOMTypedArray.cpp b/Source/core/dom/DOMTypedArray.cpp
index 7f4c52dfac3626f406e8899ab41a2f5bd49bf43b..cf74694ffc07ff32e59e78fe2b6a4dd97d8092e0 100644
--- a/Source/core/dom/DOMTypedArray.cpp
+++ b/Source/core/dom/DOMTypedArray.cpp
@@ -33,6 +33,8 @@ v8::Handle<v8::Object> DOMTypedArray<WTFTypedArray, V8TypedArray>::wrap(v8::Hand
const WrapperTypeInfo* wrapperTypeInfo = this->wrapperTypeInfo();
RefPtr<DOMArrayBuffer> buffer = this->buffer();
v8::Local<v8::Value> v8Buffer = toV8(buffer.get(), creationContext, isolate);
+ if (v8Buffer.IsEmpty())
+ return v8::Handle<v8::Object>();
ASSERT(v8Buffer->IsArrayBuffer());
haraken 2015/04/28 04:24:59 Remove.
v8::Handle<v8::Object> wrapper = V8TypedArray::New(v8Buffer.As<v8::ArrayBuffer>(), byteOffset(), length());

Powered by Google App Engine
This is Rietveld 408576698