summaryrefslogtreecommitdiffstats
path: root/WebCore/bindings/js/JSWebGLByteArrayConstructor.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'WebCore/bindings/js/JSWebGLByteArrayConstructor.cpp')
-rw-r--r--WebCore/bindings/js/JSWebGLByteArrayConstructor.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/WebCore/bindings/js/JSWebGLByteArrayConstructor.cpp b/WebCore/bindings/js/JSWebGLByteArrayConstructor.cpp
index 7db710f..f76fb1d 100644
--- a/WebCore/bindings/js/JSWebGLByteArrayConstructor.cpp
+++ b/WebCore/bindings/js/JSWebGLByteArrayConstructor.cpp
@@ -53,6 +53,10 @@ static JSObject* constructCanvasByteArray(ExecState* exec, JSObject* constructor
{
JSWebGLByteArrayConstructor* jsConstructor = static_cast<JSWebGLByteArrayConstructor*>(constructor);
RefPtr<WebGLByteArray> array = static_cast<WebGLByteArray*>(construct<WebGLByteArray, signed char>(exec, args).get());
+ if (!array.get()) {
+ setDOMException(exec, INDEX_SIZE_ERR);
+ return 0;
+ }
return asObject(toJS(exec, jsConstructor->globalObject(), array.get()));
}