fix potential for null data

This commit is contained in:
Kent Keirsey
2025-07-20 10:42:51 -04:00
committed by psychedelicious
parent 1f930cdaf2
commit 113a118fcf

View File

@@ -57,7 +57,7 @@ export const useInvertMask = () => {
const data = imageData.data;
for (let i = 3; i < data.length; i += 4) {
data[i] = 255 - data[i]; // Invert alpha
data[i] = 255 - (data[i] ?? 0); // Invert alpha
}
fullCtx.putImageData(imageData, 0, 0);