From 8a473885c7077c438d795fd0534e737b9570e7ff Mon Sep 17 00:00:00 2001 From: William Casarin Date: Tue, 4 Apr 2023 20:10:30 -0700 Subject: [PATCH] Don't add https:// prefix to empty website urls --- damus/Nostr/Nostr.swift | 3 +++ 1 file changed, 3 insertions(+) diff --git a/damus/Nostr/Nostr.swift b/damus/Nostr/Nostr.swift index efaca025..5c7c457e 100644 --- a/damus/Nostr/Nostr.swift +++ b/damus/Nostr/Nostr.swift @@ -98,6 +98,9 @@ struct Profile: Codable { } var website_url: URL? { + if self.website?.trimmingCharacters(in: .whitespacesAndNewlines) == "" { + return nil + } return self.website.flatMap { url in let trim = url.trimmingCharacters(in: .whitespacesAndNewlines) if !(trim.hasPrefix("http://") || trim.hasPrefix("https://")) {