mirror of
https://github.com/sourcegit-scm/sourcegit.git
synced 2024-12-23 20:47:25 -08:00
fix: crash when clipboard is empty
This commit is contained in:
parent
22d5927aa5
commit
d3f7c31caf
1 changed files with 4 additions and 0 deletions
|
@ -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;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue