fennifith / Alarmio

A simple alarm clock focused on design, readability, and internet radio.
https://play.google.com/store/apps/details?id=me.jfenn.alarmio
Apache License 2.0
338 stars 96 forks source link

IllegalArgumentException (invalid provider: null) in Alarmio.getSunsetCalculator #124

Open fennifith opened 4 years ago

fennifith commented 4 years ago

Should perhaps add some check for devices that don't have any location provider and remove the auto-sunrise/sunset option from the theme settings, maybe? Weird edge case.

java.lang.IllegalArgumentException: invalid provider: null
at android.location.LocationManager.checkProvider(LocationManager.java:2337)
at android.location.LocationManager.getLastKnownLocation(LocationManager.java:1427)
at me.jfenn.alarmio.Alarmio.getSunsetCalculator(Alarmio.java:375)
at me.jfenn.alarmio.Alarmio.getDayStart(Alarmio.java:331)
at me.jfenn.alarmio.data.preference.ThemePreferenceData.bindViewHolder(ThemePreferenceData.kt:116)
at me.jfenn.alarmio.data.preference.ThemePreferenceData.bindViewHolder(ThemePreferenceData.kt:34)
...