mirror of
https://github.com/invoke-ai/InvokeAI.git
synced 2026-04-23 03:00:31 -04:00
fix potential for null data
This commit is contained in:
committed by
psychedelicious
parent
1f930cdaf2
commit
113a118fcf
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user