skydoves / ColorPickerPreference

🎨 A library that lets you implement ColorPicker, ColorPickerDialog, ColorPickerPreference.
Apache License 2.0
477 stars 51 forks source link

java.lang.NullPointerException: Attempt to read from field 'int android.graphics.Point.x' on a null object reference #22

Closed 1stmetro closed 2 years ago

1stmetro commented 4 years ago

It appears i must of selected out of view and returned a null, do i need to get the source and quickly catch the error or is the library still maintained ?

Many thanks, it just crashes out the app never seen it before so its a bit strange.

java.lang.NullPointerException: Attempt to read from field 'int android.graphics.Point.x' on a null object reference at com.skydoves.colorpickerview.preference.ColorPickerPreferenceManager.setSelectorPosition(ColorPickerPreferenceManager.java:99) at com.skydoves.colorpickerview.preference.ColorPickerPreferenceManager.saveColorPickerData(ColorPickerPreferenceManager.java:207) at com.skydoves.colorpickerview.ColorPickerDialog$Builder$2.onClick(ColorPickerDialog.java:194)

skydoves commented 4 years ago

Hi, do you use the setPreferenceName method?

1stmetro commented 4 years ago

A typical example,

<com.skydoves.colorpickerpreference.ColorPickerPreference android:key="selected_tab_color" android:title="Selected tab colour" android:summary="Selected tab hightlighted Colour" app:preference_dialog_title="Selected Tab colour" app:preference_dialog_positive="Accept" app:preference_dialog_negative="Cancel" app:preference_palette="@drawable/palette" app:preference_selector="@drawable/wheel" app:default_color="#ffffffff"/>

1stmetro commented 4 years ago

I cant actually get it to go wrong again, its a weird one.

skydoves commented 4 years ago

Thanks for reporting it. I will check it soon :)

skydoves commented 4 years ago

It is released a new version 2.0.1. You can try using the new release. Thank you for your issue :)