Skip to content

Commit

Permalink
ViewBitPlane.mjs: use byteLength instead of length to check validity …
Browse files Browse the repository at this point in the history
…of ArrayBuffer
  • Loading branch information
mikecat committed Nov 1, 2022
1 parent ed8bd34 commit 58b1fb8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/core/operations/ViewBitPlane.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ class ViewBitPlane extends Operation {
* @returns {html}
*/
present(data) {
if (!data.length) return "";
if (!data.byteLength) return "";
const type = isImage(data);

return `<img src="data:${type};base64,${toBase64(data)}">`;
Expand Down

0 comments on commit 58b1fb8

Please sign in to comment.