Skip to content

Commit

Permalink
Fix type comparison
Browse files Browse the repository at this point in the history
  • Loading branch information
philips77 committed Oct 31, 2023
1 parent e6d4136 commit 566d92a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions nRFMeshProvision/Layers/Access Layer/AccessLayer.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 566d92a

Please sign in to comment.