A race condition on ColorPickerView makes apps crash
How to reproduce
Open the color picker sample
Tap multiple times quickly on Open dialog sampleor Open view sample buttons
It may require many tries to reproduce.
I personally had this crash a few times unintentionally.
com.flask.colorpicker.sample E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.flask.colorpicker.sample, PID: 22545
java.lang.NullPointerException: Attempt to invoke interface method 'java.util.Iterator java.util.List.iterator()' on a null object reference
at com.flask.colorpicker.ColorPickerView.findNearestByPosition(ColorPickerView.java:261)
at com.flask.colorpicker.ColorPickerView.onTouchEvent(ColorPickerView.java:210)
at android.view.View.dispatchTouchEvent(View.java:9993)
This PR makes sure the AbsColorWheelRenderer.colorCircleList is never null
A race condition on ColorPickerView makes apps crash
How to reproduce
Open dialog sample
orOpen view sample
buttonsIt may require many tries to reproduce. I personally had this crash a few times unintentionally.
This PR makes sure the
AbsColorWheelRenderer.colorCircleList
is never null