Avoid NPE in ColorPickerPreference.java.

This commit is contained in:
Peter Osterlund 2019-04-22 04:32:18 +02:00
parent b1f6cae789
commit 93809f5b91

View File

@ -181,9 +181,10 @@ public class ColorPickerPreference
mValue = color; mValue = color;
setPreviewColor(); setPreviewColor();
try { try {
getOnPreferenceChangeListener().onPreferenceChange(this, color); Preference.OnPreferenceChangeListener listener = getOnPreferenceChangeListener();
} catch (NullPointerException e) { if (listener != null)
listener.onPreferenceChange(this, color);
} catch (NullPointerException ignore) {
} }
} }