Add error boundary on node.DrawBackground (#311)

This commit is contained in:
Chenlei Hu
2024-08-05 15:41:12 -04:00
committed by GitHub
parent 1b96c16cca
commit 50c4c87e62

View File

@@ -657,7 +657,7 @@ export class ComfyApp {
}
}
node.prototype.onDrawBackground = function (ctx) {
function unsafeDrawBackground(ctx) {
if (!this.flags.collapsed) {
let imgURLs = []
let imagesChanged = false
@@ -992,6 +992,14 @@ export class ComfyApp {
}
}
}
node.prototype.onDrawBackground = function (ctx) {
try {
unsafeDrawBackground.call(this, ctx)
} catch (error) {
console.error('Error drawing node background', error)
}
}
}
/**