Skip to content

Commit 2f1e2c4

Browse files
Merge pull request #14873 from AUTOMATIC1111/check_extensions_list_on_apply_js_method
if extensions page not loaded, prevent apply
2 parents 8605343 + 6b8458e commit 2f1e2c4

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

javascript/extensions.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,11 @@
22
function extensions_apply(_disabled_list, _update_list, disable_all) {
33
var disable = [];
44
var update = [];
5-
6-
gradioApp().querySelectorAll('#extensions input[type="checkbox"]').forEach(function(x) {
5+
const extensions_input = gradioApp().querySelectorAll('#extensions input[type="checkbox"]');
6+
if (extensions_input.length == 0) {
7+
throw Error("Extensions page not yet loaded.");
8+
}
9+
extensions_input.forEach(function(x) {
710
if (x.name.startsWith("enable_") && !x.checked) {
811
disable.push(x.name.substring(7));
912
}

0 commit comments

Comments
 (0)