Skip to content

The most powerful and modular diffusion model GUI, api and backend with a graph/nodes interface. The fastest local inference engine in the world.

prevent crashing if the widget cant be found

pythongosssss32e115b81817
diff --git a/web/extensions/core/contextMenuFilter.js b/web/extensions/core/contextMenuFilter.js
index e0e8854b3..0b2256e8c 100644
--- a/web/extensions/core/contextMenuFilter.js
+++ b/web/extensions/core/contextMenuFilter.js
@@ -27,10 +27,10 @@ const ext = {
const clickedComboValue = currentNode.widgets
.filter(w => w.type === "combo" && w.options.values.length === values.length)
.find(w => w.options.values.every((v, i) => v === values[i]))
- .value;
+ ?.value;
- let selectedIndex = values.findIndex(v => v === clickedComboValue);
- let selectedItem = displayedItems?.[selectedIndex];
+ let selectedIndex = clickedComboValue ? values.findIndex(v => v === clickedComboValue) : 0;
+ let selectedItem = displayedItems[selectedIndex];
updateSelected();
// Apply highlighting to the selected item