hbb20 / CountryCodePickerProject

Country Code Picker (CCP) is an android library which provides an easy way to search and select country or international phone code. Also supports Android EditText phone mask and international phone validation.
Apache License 2.0
1.52k stars 506 forks source link

NullPointerException when no country of preference #310

Closed ndal closed 5 years ago

ndal commented 5 years ago

When using the xml property app:ccpDialog_initialScrollToSelection, a NullPointerException is launched if there is no country of preference.

Version of the libary: 2.2.9.

Stack trace :


java.lang.NullPointerException: Attempt to invoke interface method 'java.util.Iterator java.util.List.iterator()' on a null object reference
        at com.hbb20.CountryCodeDialog.openCountryCodeDialog(CountryCodeDialog.java:226)
        at com.hbb20.CountryCodePicker.launchCountrySelectionDialog(CountryCodePicker.java:2088)
        at com.hbb20.CountryCodePicker$1.onClick(CountryCodePicker.java:134)
        at android.view.View.performClick(View.java:6669)
        at android.view.View.performClickInternal(View.java:6638)
        at android.view.View.access$3100(View.java:789)
        at android.view.View$PerformClick.run(View.java:26145)
        at android.os.Handler.handleCallback(Handler.java:873)
        at android.os.Handler.dispatchMessage(Handler.java:99)
        at android.os.Looper.loop(Looper.java:193)
        at android.app.ActivityThread.main(ActivityThread.java:6863)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:537)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858)```
hbb20 commented 5 years ago

Thank you so much for reporting. I will look into it....

hbb20 commented 5 years ago

We found the problem and will fix in the next version. Thank you so much for reporting.

ndal commented 5 years ago

Perfect, thank you for being so quick!

ndal commented 5 years ago

Is there an ETA for this next release @hbb20?