Update Meshtastic/Extensions/CoreData/NodeInfoEntityToNodeInfo.swift

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This commit is contained in:
Ben Meadors 2025-05-13 20:09:35 -05:00 committed by GitHub
parent bf55f3526d
commit 382402afa9
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -13,7 +13,7 @@ extension NodeInfoEntity {
userProto.id = user.userId ?? ""
userProto.longName = user.longName ?? ""
userProto.shortName = user.shortName ?? ""
userProto.hwModel = HardwareModel(rawValue: Int(user.hwModelId))!
userProto.hwModel = HardwareModel(rawValue: Int(user.hwModelId)) ?? .unknown
userProto.isLicensed = user.isLicensed
userProto.role = Config.DeviceConfig.Role(rawValue: Int(user.role)) ?? .unknown
userProto.publicKey = user.publicKey?.subdata(in: 0..<user.publicKey!.count) ?? Data()