forked from j62/ctbrec
1
0
Fork 0

Fixed possible NPE in CtbrecPreferencesStorage

This commit is contained in:
0xb00bface 2020-12-12 15:19:58 +01:00
parent 7d343db450
commit ae14844170
1 changed files with 1 additions and 1 deletions

View File

@ -222,7 +222,7 @@ public class CtbrecPreferencesStorage implements PreferencesStorage {
if (!ctrl.getText().isEmpty()) {
Field field = Settings.class.getField(setting.getKey());
field.set(settings, Integer.parseInt(ctrl.getText()));
if (setting.doesNeedRestart() && !Objects.equals(oldV, newV)) {
if (setting.doesNeedRestart() && !Objects.equals(oldV, newV) && prefs != null) {
prefs.getRestartRequiredCallback().run();
}
config.save();