Skip to content

Commit

Permalink
Fixed issues when there isn't a specified website (#178)
Browse files Browse the repository at this point in the history
  • Loading branch information
Leo-Peyronnet committed Mar 21, 2021
1 parent c9706be commit e4d8a10
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions InternetTest/InternetTest/Pages/DownDetectorPage.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -102,13 +102,19 @@ private string FormatURL(string url)

private void CheckBtn_Click(object sender, RoutedEventArgs e)
{
Test(FormatURL(WebsiteTxt.Text)); // Test
WebsiteTxt.Text = FormatURL(WebsiteTxt.Text); // Formar
if (!string.IsNullOrEmpty(WebsiteTxt.Text) && !string.IsNullOrWhiteSpace(WebsiteTxt.Text))
{
Test(FormatURL(WebsiteTxt.Text)); // Test
WebsiteTxt.Text = FormatURL(WebsiteTxt.Text); // Format
}
}

private void OpenBrowserBtn_Click(object sender, RoutedEventArgs e)
{
Global.OpenLinkInBrowser(FormatURL(WebsiteTxt.Text)); // Open in a browser
if (!string.IsNullOrEmpty(WebsiteTxt.Text) && !string.IsNullOrWhiteSpace(WebsiteTxt.Text))
{
Global.OpenLinkInBrowser(FormatURL(WebsiteTxt.Text)); // Open in a browser
}
}
}
}

0 comments on commit e4d8a10

Please sign in to comment.