mirror of
https://github.com/vladmandic/automatic
synced 2026-09-19 09:14:35 +02:00
fix(api): set compatibility options without crashing
clip_skip and the uni_pc_* opts live in opts.data without an OptionInfo in data_labels (compatibility_opts). Options.set() read data_labels[key].onchange unconditionally, so setting clip_skip via /sdapi/v1/options raised KeyError and returned 500; the override_settings restore path had the same unguarded data_labels[k] access for falsy-valued compat opts. Guard the onchange lookup and read the stored value via getattr(opts, k), which already falls back through data then data_labels.
This commit is contained in:
@@ -109,7 +109,8 @@ class Options:
|
||||
setattr(self, key, value)
|
||||
except RuntimeError:
|
||||
return False
|
||||
func = self.data_labels[key].onchange
|
||||
# compatibility_opts (e.g. clip_skip) live in data without a data_labels entry
|
||||
func = self.data_labels[key].onchange if key in self.data_labels else None
|
||||
if func is not None:
|
||||
try:
|
||||
func()
|
||||
|
||||
Reference in New Issue
Block a user