mirror of
				https://github.com/AUTOMATIC1111/stable-diffusion-webui.git
				synced 2025-10-30 17:38:51 +00:00 
			
		
		
		
	Merge pull request #14487 from AUTOMATIC1111/handle-selectable-script_index-is-None
handle selectable script_index is None
This commit is contained in:
		
						commit
						e55fec9d9a
					
				| @ -696,6 +696,8 @@ class ScriptRunner: | |||||||
|         self.setup_ui_for_section(None, self.selectable_scripts) |         self.setup_ui_for_section(None, self.selectable_scripts) | ||||||
| 
 | 
 | ||||||
|         def select_script(script_index): |         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 |             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] |             return [gr.update(visible=selected_script == s) for s in self.selectable_scripts] | ||||||
| @ -739,7 +741,7 @@ class ScriptRunner: | |||||||
|     def run(self, p, *args): |     def run(self, p, *args): | ||||||
|         script_index = args[0] |         script_index = args[0] | ||||||
| 
 | 
 | ||||||
|         if script_index == 0: |         if script_index == 0 or script_index is None: | ||||||
|             return None |             return None | ||||||
| 
 | 
 | ||||||
|         script = self.selectable_scripts[script_index-1] |         script = self.selectable_scripts[script_index-1] | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user
	 AUTOMATIC1111
						AUTOMATIC1111