mirror of
https://github.com/jupyter/notebook.git
synced 2025-01-06 11:35:24 +08:00
Typecheck the .buffer attribute before assuming it is an ArrayBuffer
This commit is contained in:
parent
aa8e36064c
commit
94724fdee1
@ -79,7 +79,8 @@ define([
|
||||
for (i = 0; i < msg.buffers.length; i++) {
|
||||
// msg.buffers elements could be either views or ArrayBuffers
|
||||
// buffers elements are ArrayBuffers
|
||||
buffers.push(msg.buffers[i].buffer || msg.buffers[i])
|
||||
var b = msg.buffers[i];
|
||||
buffers.push(b.buffer instanceof ArrayBuffer ? b.buffer : b);
|
||||
}
|
||||
delete msg.buffers;
|
||||
var json_utf8 = (new TextEncoder('utf8')).encode(JSON.stringify(msg));
|
||||
|
Loading…
Reference in New Issue
Block a user