From d3f7c31caf14560a95f4b1ff94065f4da762bb93 Mon Sep 17 00:00:00 2001 From: leo Date: Tue, 9 Jul 2024 15:02:34 +0800 Subject: [PATCH] fix: crash when clipboard is empty --- src/Models/Remote.cs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/Models/Remote.cs b/src/Models/Remote.cs index 29c10d51..e068deda 100644 --- a/src/Models/Remote.cs +++ b/src/Models/Remote.cs @@ -40,11 +40,15 @@ namespace SourceGit.Models public static bool IsValidURL(string url) { + if (string.IsNullOrWhiteSpace(url)) + return false; + foreach (var fmt in URL_FORMATS) { if (fmt.IsMatch(url)) return true; } + return false; }