Fix message wrapping issue

Very occasionally this could fail due to an invalid character in the encrypted message content
This commit is contained in:
nielsandriesse 2020-06-05 16:47:18 +10:00
parent 95db7d36e9
commit 5ee2307c6a

View file

@ -33,7 +33,7 @@ public enum LokiMessageWrapper {
let builder = SSKProtoEnvelope.builder(type: message.type, timestamp: message.timestamp)
builder.setSource(message.senderPublicKey)
builder.setSourceDevice(message.senderDeviceID)
if let content = try Data(base64Encoded: message.content) {
if let content = try Data(base64Encoded: message.content, options: .ignoreUnknownCharacters) {
builder.setContent(content)
} else {
throw Error.failedToWrapMessageInEnvelope