Fix a couple of nils

This commit is contained in:
Garth Vander Houwen 2022-11-11 19:21:52 -08:00
parent 836b3fb007
commit b4b158aabf
2 changed files with 3 additions and 5 deletions

View file

@ -520,8 +520,8 @@ class BLEManager: NSObject, ObservableObject, CBCentralManagerDelegate, CBPeriph
if nodeInfo != nil {
if self.connectedPeripheral != nil && self.connectedPeripheral.num == nodeInfo!.num {
if nodeInfo!.user != nil {
connectedPeripheral.shortName = nodeInfo!.user!.shortName ?? "????"
connectedPeripheral.longName = nodeInfo!.user!.longName ?? "Unknown"
connectedPeripheral.shortName = nodeInfo?.user?.shortName ?? "????"
connectedPeripheral.longName = nodeInfo?.user?.longName ?? "Unknown"
}
}
}

View file

@ -7,15 +7,13 @@ import CoreData
struct MeshtasticAppleApp: App {
let persistenceController = PersistenceController.shared
@ObservedObject private var bleManager: BLEManager = BLEManager.shared
@ObservedObject private var userSettings: UserSettings = UserSettings()
@Environment(\.scenePhase) var scenePhase
@State var saveChannels = false
@State var incomingUrl: URL?
@State var channelSettings: String?
@Environment(\.scenePhase) var scenePhase
var body: some Scene {
WindowGroup {