mirror of
https://github.com/meshtastic/Meshtastic-Apple.git
synced 2026-04-20 22:13:56 +00:00
Apply suggestion from @Copilot
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This commit is contained in:
parent
6b262aa448
commit
c8c79abb9e
1 changed files with 4 additions and 1 deletions
|
|
@ -1186,7 +1186,10 @@ class BLEManager: NSObject, CBPeripheralDelegate, MqttClientProxyManagerDelegate
|
|||
success = false
|
||||
|
||||
} else {
|
||||
let fromUserNum: Int64 = self.connectedPeripheral?.num ?? 0
|
||||
guard let fromUserNum = self.connectedPeripheral?.num else {
|
||||
Logger.mesh.error("🚫 Connected peripheral user number is nil, cannot send message.")
|
||||
return false
|
||||
}
|
||||
|
||||
let messageUsers = UserEntity.fetchRequest()
|
||||
messageUsers.predicate = NSPredicate(format: "num IN %@", [fromUserNum, Int64(toUserNum)])
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue