Merge pull request #52 from lgoix/fixUnrecognizedConfig

Fix the crash from unrecognized ModemConfig  #50
This commit is contained in:
Kevin Hester 2020-06-15 20:40:54 -07:00 committed by GitHub
commit cd1047d5c2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -168,7 +168,10 @@ class ChannelFragment : ScreenFragment("Channel"), Logging {
val selectedChannelOptionString =
filled_exposed_dropdown.editableText.toString()
newSettings.modemConfig = getModemConfig(selectedChannelOptionString)
val modemConfig = getModemConfig(selectedChannelOptionString)
if (modemConfig!=MeshProtos.ChannelSettings.ModemConfig.UNRECOGNIZED)
newSettings.modemConfig = modemConfig
// Try to change the radio, if it fails, tell the user why and throw away their redits
try {
model.setChannel(newSettings.build())