From a810a59b20d562b5bf76055af849ec91e8b5186b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Leon=20B=C3=B6ttger?= Date: Sat, 3 May 2025 14:55:05 +0200 Subject: [PATCH] Try to fix protobuf decoding error --- NearbyShare/InboundNearbyConnection.swift | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/NearbyShare/InboundNearbyConnection.swift b/NearbyShare/InboundNearbyConnection.swift index 8e7e281..53e164e 100644 --- a/NearbyShare/InboundNearbyConnection.swift +++ b/NearbyShare/InboundNearbyConnection.swift @@ -69,11 +69,9 @@ class InboundNearbyConnection: NearbyConnection{ try decryptAndProcessReceivedSecureMessage(smsg) } }catch{ - lastError=error - log("Deserialization error: \(error) in state \(currentState)") -#if !DEBUG - protocolError() -#endif + lastError = error + log("Deserialization error: \(error) in state \(currentState). Payload: \(frameData.hex)") + //protocolError() } } @@ -555,3 +553,9 @@ public class SaveFilesManager { } } } + +extension Data { + var hex: String { + return map { String(format: "%02hhx", $0) }.joined() + } +}