summaryrefslogtreecommitdiffstats
path: root/WebCore/bindings/js/JSWebGLUnsignedByteArrayConstructor.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'WebCore/bindings/js/JSWebGLUnsignedByteArrayConstructor.cpp')
-rw-r--r--WebCore/bindings/js/JSWebGLUnsignedByteArrayConstructor.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/WebCore/bindings/js/JSWebGLUnsignedByteArrayConstructor.cpp b/WebCore/bindings/js/JSWebGLUnsignedByteArrayConstructor.cpp
index d5597ce..dcb940e 100644
--- a/WebCore/bindings/js/JSWebGLUnsignedByteArrayConstructor.cpp
+++ b/WebCore/bindings/js/JSWebGLUnsignedByteArrayConstructor.cpp
@@ -30,6 +30,7 @@
#include "JSWebGLUnsignedByteArrayConstructor.h"
#include "Document.h"
+#include "ExceptionCode.h"
#include "WebGLUnsignedByteArray.h"
#include "JSWebGLArrayBuffer.h"
#include "JSWebGLArrayBufferConstructor.h"
@@ -53,6 +54,10 @@ static JSObject* constructCanvasUnsignedByteArray(ExecState* exec, JSObject* con
{
JSWebGLUnsignedByteArrayConstructor* jsConstructor = static_cast<JSWebGLUnsignedByteArrayConstructor*>(constructor);
RefPtr<WebGLUnsignedByteArray> array = static_cast<WebGLUnsignedByteArray*>(construct<WebGLUnsignedByteArray, unsigned char>(exec, args).get());
+ if (!array.get()) {
+ setDOMException(exec, INDEX_SIZE_ERR);
+ return 0;
+ }
return asObject(toJS(exec, jsConstructor->globalObject(), array.get()));
}