Skip to content

Commit

Permalink
Strip any whitespaces from QR codes before trying to parse the URL.
Browse files Browse the repository at this point in the history
  • Loading branch information
jensutbult committed Sep 26, 2023
1 parent 45199ae commit 82a05c1
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,7 @@ class ScanAccountView: UIView, AVCaptureMetadataOutputObjectsDelegate {
guard let metadataObject = metadataObjects.first,
let readableObject = metadataObject as? AVMetadataMachineReadableCodeObject,
let stringValue = readableObject.stringValue else { return }
guard let url = URL(string: stringValue) else {
guard let url = URL(string: stringValue.trimmingCharacters(in: .whitespacesAndNewlines)) else {
showError("No account information found!")
return
}
Expand Down

0 comments on commit 82a05c1

Please sign in to comment.