diff options
author | AUTOMATIC <16777216c@gmail.com> | 2023-01-02 17:46:51 +0000 |
---|---|---|
committer | AUTOMATIC <16777216c@gmail.com> | 2023-01-02 17:46:51 +0000 |
commit | 8d12a729b8b036cb765cf2d87576d5ae256135c8 (patch) | |
tree | 89272b11500a419d49eaa07dff0028c193bf0921 /modules/ui.py | |
parent | 84dd7e8e2495c4fc2997e97f8267aa831eb90d11 (diff) | |
download | stable-diffusion-webui-gfx803-8d12a729b8b036cb765cf2d87576d5ae256135c8.tar.gz stable-diffusion-webui-gfx803-8d12a729b8b036cb765cf2d87576d5ae256135c8.tar.bz2 stable-diffusion-webui-gfx803-8d12a729b8b036cb765cf2d87576d5ae256135c8.zip |
fix possible error with accessing nonexistent setting
Diffstat (limited to 'modules/ui.py')
-rw-r--r-- | modules/ui.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/modules/ui.py b/modules/ui.py index 67a51888..9350a80f 100644 --- a/modules/ui.py +++ b/modules/ui.py @@ -491,7 +491,7 @@ def apply_setting(key, value): return
valtype = type(opts.data_labels[key].default)
- oldval = opts.data[key]
+ oldval = opts.data.get(key, None)
opts.data[key] = valtype(value) if valtype != type(None) else value
if oldval != value and opts.data_labels[key].onchange is not None:
opts.data_labels[key].onchange()
|