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

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: 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/core/dom/DOMDataView.cpp ('k') | Source/web/InspectorOverlayImpl.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/dom/DOMTypedArray.cpp
diff --git a/Source/core/dom/DOMTypedArray.cpp b/Source/core/dom/DOMTypedArray.cpp
index 3b8b26f79a90f19b5c7a7beae150b0d006bb63c4..fd437b31fda51898b660ce92b4f2fa949faceb1a 100644
--- a/Source/core/dom/DOMTypedArray.cpp
+++ b/Source/core/dom/DOMTypedArray.cpp
@@ -33,6 +33,8 @@ v8::Local<v8::Object> DOMTypedArray<WTFTypedArray, V8TypedArray>::wrap(v8::Isola
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());
v8::Local<v8::Object> wrapper = V8TypedArray::New(v8Buffer.As<v8::ArrayBuffer>(), byteOffset(), length());
« no previous file with comments | « Source/core/dom/DOMDataView.cpp ('k') | Source/web/InspectorOverlayImpl.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698