fix possible error with accessing nonexistent setting

This commit is contained in:
AUTOMATIC 2023-01-02 20:46:51 +03:00
parent 84dd7e8e24
commit 8d12a729b8

View file

@ -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()