Guard geometryBlobToPath against non-Uint8Array blobs

Return empty path if blob is missing or its buffer is not an
ArrayBuffer, preventing DataView constructor crash during rendering.
This commit is contained in:
Danila Poyarkov 2026-03-04 23:27:20 +03:00
parent 7dbba7b2af
commit 829bafa698

View file

@ -348,6 +348,7 @@ export function geometryBlobToPath(
windingRule: WindingRule
): Path {
const path = new ck.Path()
if (!blob || !(blob.buffer instanceof ArrayBuffer)) return path
const dv = new DataView(blob.buffer, blob.byteOffset, blob.byteLength)
let o = 0