Skip to content

Commit 64c23ac

Browse files
author
Isaac
committed
Fix url handling
1 parent 3d6fabe commit 64c23ac

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

submodules/UrlHandling/Sources/UrlHandling.swift

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -600,9 +600,12 @@ public func parseInternalUrl(sharedContext: SharedAccountContext, context: Accou
600600
return .peer(.name(pathComponents[1]), .boost)
601601
} else if pathComponents[0] == "giftcode", pathComponents.count == 2 {
602602
return .premiumGiftCode(slug: pathComponents[1])
603-
} else if pathComponents.count >= 3 && pathComponents[0] == "newbot" {
603+
} else if pathComponents.count >= 2 && pathComponents[0] == "newbot" {
604604
let parentBot = pathComponents[1]
605-
let username = pathComponents[2]
605+
var username: String?
606+
if pathComponents.count >= 3 {
607+
username = pathComponents[2]
608+
}
606609
var title: String?
607610
for queryItem in components.queryItems ?? [] {
608611
if let value = queryItem.value {

0 commit comments

Comments
 (0)