mirror of
https://github.com/meshtastic/Meshtastic-Android.git
synced 2026-04-20 22:23:37 +00:00
fix autobug crash when primary channel is null
This commit is contained in:
parent
fa17c4efe1
commit
98356b9205
5 changed files with 53 additions and 48 deletions
|
|
@ -47,9 +47,11 @@ data class ChannelSet(
|
|||
/**
|
||||
* Return the primary channel info
|
||||
*/
|
||||
val primaryChannel: Channel get() {
|
||||
return Channel(protobuf.getSettings(0))
|
||||
}
|
||||
val primaryChannel: Channel? get() =
|
||||
if(protobuf.settingsCount > 0)
|
||||
Channel(protobuf.getSettings(0))
|
||||
else
|
||||
null
|
||||
|
||||
/// Return an URL that represents the current channel values
|
||||
/// @param upperCasePrefix - portions of the URL can be upper case to make for more efficient QR codes
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue