kopia lustrzana https://github.com/meshtastic/Meshtastic-Android
fix: `getNumber` exception for unrecognized `RegionCode` entries
Fatal Exception: java.lang.IllegalArgumentException: Can't get the number of an unknown enum value.pull/1375/head
rodzic
605ef120c9
commit
f2511f814c
|
@ -97,10 +97,11 @@ class SettingsFragment : ScreenFragment("Settings"), Logging {
|
||||||
spinner.isEnabled = !model.isManaged
|
spinner.isEnabled = !model.isManaged
|
||||||
|
|
||||||
// Update the status string (highest priority messages first)
|
// Update the status string (highest priority messages first)
|
||||||
|
val regionUnset = region == ConfigProtos.Config.LoRaConfig.RegionCode.UNSET
|
||||||
val info = model.myNodeInfo.value
|
val info = model.myNodeInfo.value
|
||||||
when (connectionState) {
|
when (connectionState) {
|
||||||
MeshService.ConnectionState.CONNECTED ->
|
MeshService.ConnectionState.CONNECTED ->
|
||||||
if (region.number == 0) R.string.must_set_region else R.string.connected_to
|
if (regionUnset) R.string.must_set_region else R.string.connected_to
|
||||||
MeshService.ConnectionState.DISCONNECTED -> R.string.not_connected
|
MeshService.ConnectionState.DISCONNECTED -> R.string.not_connected
|
||||||
MeshService.ConnectionState.DEVICE_SLEEP -> R.string.connected_sleeping
|
MeshService.ConnectionState.DEVICE_SLEEP -> R.string.connected_sleeping
|
||||||
else -> null
|
else -> null
|
||||||
|
|
Ładowanie…
Reference in New Issue