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;
setPreviewColor();
try {
getOnPreferenceChangeListener().onPreferenceChange(this, color);
} catch (NullPointerException e) {
Preference.OnPreferenceChangeListener listener = getOnPreferenceChangeListener();
if (listener != null)
listener.onPreferenceChange(this, color);
} catch (NullPointerException ignore) {
}
}