Bug 929786 - Don't forget that JS_ValueToObject can return null (r=bustage)

--HG--
extra : rebase_source : 6bad633d1ad32c73ec749275a61d9ab37a367089
This commit is contained in:
Luke Wagner 2013-10-24 09:47:03 -05:00
parent 0d5ad78783
commit 7e5f227f3b

View File

@ -1327,6 +1327,11 @@ Neuter(JSContext *cx, unsigned argc, jsval *vp)
if (!JS_ValueToObject(cx, args.get(0), &obj))
return false;
if (!obj) {
JS_ReportError(cx, "neuter must be passed an object");
return false;
}
void *contents;
uint8_t *data;
if (!JS_StealArrayBufferContents(cx, obj, &contents, &data))