Apply suggestion from @Copilot

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This commit is contained in:
Ben Meadors 2025-07-07 10:50:30 -05:00 committed by GitHub
parent 6b262aa448
commit c8c79abb9e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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)])