JoanZapata / android-iconify

Android integration of multiple icon providers such as FontAwesome, Entypo, Typicons,...
http://joanzapata.com/android-iconify
Other
3.93k stars 525 forks source link

Crash in IconDrawable with AppCompatCheckBox calling setState with null in API <= 18 #185

Open ehogan-jcp opened 7 years ago

ehogan-jcp commented 7 years ago

I found an issue with the IconDrawable class being used as input to AppCompatCheckBox.setButtonDrawable. In Android API 18 or earlier, the setState method of the drawable is called twice by the AppCompatCheckBox code, the second time sending in a null value for the stateSet array. This causes a NPE in your isEnabled method as it does not check for null input.

I worked around the issue by extending your class and doing the null check myself in setState. I raised this issue because I thought you might want to include the fix in a future release.