mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-02-10 01:50:08 +00:00
[TS] Use strict mode in LGraphGroup (#599)
- Adds `NullGraphError` to reduce boilerplate null check code - Prefer optional `undefined` to explicit `null` - Related: https://github.com/Comfy-Org/litegraph.js/issues/595 - Adds strict types
This commit is contained in:
6
src/infrastructure/NullGraphError.ts
Normal file
6
src/infrastructure/NullGraphError.ts
Normal file
@@ -0,0 +1,6 @@
|
||||
export class NullGraphError extends Error {
|
||||
constructor(message: string = "Attempted to access LGraph reference that was null or undefined.", cause?: Error) {
|
||||
super(message, { cause })
|
||||
this.name = "NullGraphError"
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user