mirror of
https://github.com/meshtastic/Meshtastic-Android.git
synced 2026-03-17 13:28:01 -04:00
never let getMyNodeInfo ever return null. fixes an autobug for device removal
This commit is contained in:
@@ -64,7 +64,8 @@ interface IMeshService {
|
||||
/// Users should not call this directly, only used internally by the MeshUtil activity
|
||||
void setDeviceAddress(String deviceAddr);
|
||||
|
||||
/// Get basic device hardware info about our connected radio
|
||||
/// Get basic device hardware info about our connected radio. Will never return NULL. Will throw
|
||||
/// RemoteException if no my node info is available
|
||||
MyNodeInfo getMyNodeInfo();
|
||||
|
||||
/// Start updating the radios firmware
|
||||
|
||||
@@ -1488,7 +1488,9 @@ class MeshService : Service(), Logging {
|
||||
doFirmwareUpdate()
|
||||
}
|
||||
|
||||
override fun getMyNodeInfo(): MyNodeInfo? = this@MeshService.myNodeInfo
|
||||
override fun getMyNodeInfo(): MyNodeInfo = toRemoteExceptions {
|
||||
this@MeshService.myNodeInfo ?: throw RadioNotConnectedException("No MyNodeInfo")
|
||||
}
|
||||
|
||||
override fun getMyId() = toRemoteExceptions { myNodeID }
|
||||
|
||||
|
||||
Reference in New Issue
Block a user