aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAUTOMATIC1111 <16777216c@gmail.com>2024-01-01 10:19:58 +0300
committerGitHub <noreply@github.com>2024-01-01 10:19:58 +0300
commite55fec9d9a8abf01d37ecb80f3fb1e521afe0d0b (patch)
tree18c6a576c19d085e365ae549c6fc3aee71e1e51b
parenta70dfb64a86b9b6d869deffdb0ffebe980365473 (diff)
parent00901bfbe0095303554f4440b4c12fac262e2e89 (diff)
Merge pull request #14487 from AUTOMATIC1111/handle-selectable-script_index-is-None
handle selectable script_index is None
-rw-r--r--modules/scripts.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/modules/scripts.py b/modules/scripts.py
index 3a766911..017aed5a 100644
--- a/modules/scripts.py
+++ b/modules/scripts.py
@@ -696,6 +696,8 @@ class ScriptRunner:
self.setup_ui_for_section(None, self.selectable_scripts)
def select_script(script_index):
+ if script_index is None:
+ script_index = 0
selected_script = self.selectable_scripts[script_index - 1] if script_index>0 else None
return [gr.update(visible=selected_script == s) for s in self.selectable_scripts]
@@ -739,7 +741,7 @@ class ScriptRunner:
def run(self, p, *args):
script_index = args[0]
- if script_index == 0:
+ if script_index == 0 or script_index is None:
return None
script = self.selectable_scripts[script_index-1]