Skip to content

Commit

Permalink
feat(ios): fix crash on decrypt
Browse files Browse the repository at this point in the history
  • Loading branch information
amitaymolko committed Jan 6, 2022
1 parent aa448e5 commit 540b77f
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions ios/RSAECNative.swift
Original file line number Diff line number Diff line change
Expand Up @@ -367,6 +367,9 @@ class RSAECNative: NSObject {
public func decrypt(message: String) -> String? {
guard let data = Data(base64Encoded: message, options: .ignoreUnknownCharacters) else { return nil }
let decrypted = self._decrypt(data: data)
if (decrypted == nil) {
return nil
}
return String(data: decrypted!, encoding: String.Encoding.utf8)
}

Expand Down

0 comments on commit 540b77f

Please sign in to comment.