fix: crash when clipboard is empty

This commit is contained in:
leo 2024-07-09 15:02:34 +08:00
parent 22d5927aa5
commit d3f7c31caf
No known key found for this signature in database

View file

@ -40,11 +40,15 @@ namespace SourceGit.Models
public static bool IsValidURL(string url) public static bool IsValidURL(string url)
{ {
if (string.IsNullOrWhiteSpace(url))
return false;
foreach (var fmt in URL_FORMATS) foreach (var fmt in URL_FORMATS)
{ {
if (fmt.IsMatch(url)) if (fmt.IsMatch(url))
return true; return true;
} }
return false; return false;
} }