From 566d92a8481f3469971f926fc5f7d5455372b49d Mon Sep 17 00:00:00 2001 From: Aleksander Nowakowski Date: Tue, 31 Oct 2023 09:52:57 +0100 Subject: [PATCH] Fix type comparison --- nRFMeshProvision/Layers/Access Layer/AccessLayer.swift | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/nRFMeshProvision/Layers/Access Layer/AccessLayer.swift b/nRFMeshProvision/Layers/Access Layer/AccessLayer.swift index 6527e67ca..33ef58d09 100644 --- a/nRFMeshProvision/Layers/Access Layer/AccessLayer.swift +++ b/nRFMeshProvision/Layers/Access Layer/AccessLayer.swift @@ -403,11 +403,11 @@ private extension AccessLayer { if newMessage == nil { logger?.i(.model, "\(message) received from: \(accessPdu.source.hex), to: \(accessPdu.destination.hex)") newMessage = message - } else if type(of: message) != type(of: newMessage) { + } else if let newMessage = newMessage, type(of: message) != type(of: newMessage) { // If another model's delegate decoded the same message to a different // type, log this with a warning. This other type will be delivered // to the delegate, but not to the global network delegate. - logger?.w(.model, "\(message) already decoded as \(newMessage!)") + logger?.w(.model, "\(message) already decoded as \(newMessage)") } // Deliver the message to the Model if it was signed with an // Application Key bound to this Model and the message is