mirror of
https://github.com/meshtastic/Meshtastic-Android.git
synced 2026-04-20 22:23:37 +00:00
fix: getNumber exception for unrecognized RegionCode entries
Fatal Exception: java.lang.IllegalArgumentException: Can't get the number of an unknown enum value.
This commit is contained in:
parent
605ef120c9
commit
f2511f814c
1 changed files with 2 additions and 1 deletions
|
|
@ -97,10 +97,11 @@ class SettingsFragment : ScreenFragment("Settings"), Logging {
|
|||
spinner.isEnabled = !model.isManaged
|
||||
|
||||
// Update the status string (highest priority messages first)
|
||||
val regionUnset = region == ConfigProtos.Config.LoRaConfig.RegionCode.UNSET
|
||||
val info = model.myNodeInfo.value
|
||||
when (connectionState) {
|
||||
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.DEVICE_SLEEP -> R.string.connected_sleeping
|
||||
else -> null
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue