AlUlkesh / stable-diffusion-webui-images-browser

an images browse for stable-diffusion-webui
623 stars 111 forks source link

if last_default_tab[0] == "Others": TypeError: 'NoneType' object is not subscriptable #199

Closed profenpoche closed 1 year ago

profenpoche commented 1 year ago

Hello guys,

Error loading script: image_browser.py Traceback (most recent call last): File "/home/samuel/dev/stable-diffusion-webui/modules/scripts.py", line 263, in load_scripts script_module = script_loading.load_module(scriptfile.path) File "/home/samuel/dev/stable-diffusion-webui/modules/script_loading.py", line 10, in load_module module_spec.loader.exec_module(module) File "", line 883, in exec_module File "", line 241, in _call_with_frames_removed File "/home/samuel/dev/stable-diffusion-webui/extensions/stable-diffusion-webui-images-browser/scripts/image_browser.py", line 105, in check_image_browser_active_tabs() File "/home/samuel/dev/stable-diffusion-webui/extensions/stable-diffusion-webui-images-browser/scripts/image_browser.py", line 95, in check_image_browser_active_tabs if last_default_tab[0] == "Others": TypeError: 'NoneType' object is not subscriptable

Fix :

if last_default_tab is None or last_default_tab[0] == "Others":
        # New tabs don't exist yet in image_browser_active_tabs, add them
        ...

Thanks for the work !

AlUlkesh commented 1 year ago

That shouldn't be happening.

I wonder if this is an update issue. Can you stop and completely restart webui and see if this still happens?

profenpoche commented 1 year ago

After reverting my fix and reload, no error :+1: