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:
CalamitousFelicitousness
2026-06-25 02:18:45 +01:00
parent 3dd0cd590c
commit a6fe828aa2
2 changed files with 5 additions and 3 deletions
+2 -1
View File
@@ -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()