Skip to content

Commit 4523fb8

Browse files
committed
Check for a valid repository Url for Git Repositort Button Nest
1 parent 856f9bb commit 4523fb8

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

VisualStudioDiscordRPC.Shared/Nests/Base/BaseButtonNest.cs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,15 +31,17 @@ private void UpdateButtonWithInfo(int index, ButtonInfo buttonInfo)
3131
default: throw new ArgumentOutOfRangeException($"{nameof(index)} must be 0 or 1");
3232
}
3333

34-
if (string.IsNullOrEmpty(buttonInfo.Label) || string.IsNullOrEmpty(buttonInfo.Url))
34+
if (string.IsNullOrEmpty(buttonInfo.Label) ||
35+
string.IsNullOrEmpty(buttonInfo.Url) ||
36+
Uri.TryCreate(buttonInfo.Url, UriKind.Absolute, out Uri _))
3537
{
3638
Buttons.Remove(button);
3739
return;
3840
}
3941

4042
button.Label = buttonInfo.Label;
4143
button.Url = buttonInfo.Url;
42-
44+
4345
if (!Buttons.Contains(button))
4446
{
4547
Buttons.Add(button);

0 commit comments

Comments
 (0)