Skip to content

Commit

Permalink
fix(paste): result might be nil after successful detection
Browse files Browse the repository at this point in the history
  • Loading branch information
mhamann committed Apr 17, 2023
1 parent 9120054 commit 6fd429c
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions Sources/Rownd/Rownd.swift
Original file line number Diff line number Diff line change
Expand Up @@ -55,12 +55,13 @@ public class Rownd: NSObject {
switch result {
case .success(let detectedPatterns):
if detectedPatterns.contains(UIPasteboard.DetectionPattern.probableWebURL) {
var _launchUrl = UIPasteboard.general.string!
if !_launchUrl.starts(with: "http") {
_launchUrl = "https://\(_launchUrl)"
if var _launchUrl = UIPasteboard.general.string {
if !_launchUrl.starts(with: "http") {
_launchUrl = "https://\(_launchUrl)"
}
launchUrl = URL(string: _launchUrl)
handleSignInLink(url: launchUrl)
}
launchUrl = URL(string: _launchUrl)
handleSignInLink(url: launchUrl)
}
default:
break
Expand Down

0 comments on commit 6fd429c

Please sign in to comment.