mirror of
https://github.com/AUTOMATIC1111/stable-diffusion-webui.git
synced 2025-01-31 02:32:57 +08:00
fix possible error with accessing nonexistent setting
This commit is contained in:
parent
84dd7e8e24
commit
8d12a729b8
@ -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()
|
||||
|
Loading…
Reference in New Issue
Block a user