Skip to content

Commit 5a97742

Browse files
committed
* Prevent the user from doing weird things
1 parent 370d56f commit 5a97742

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

Advanced PortChecker/Windows/MainWindow.xaml.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,12 @@ private void ControlsEnabled(bool enabled)
171171
private void BtnScan_Click(object sender, RoutedEventArgs e)
172172
{
173173
if (IntStart.Value == null || IntStop.Value == null) return;
174+
if (IntStart.Value > IntStop.Value)
175+
{
176+
MessageBox.Show("The starting port cannot be greater than the ending port!", "Advanced PortChecker", MessageBoxButton.OK, MessageBoxImage.Error);
177+
return;
178+
}
179+
174180
if (_operations != null && _operations.Count > 0)
175181
{
176182
MessageBox.Show("A previous scan is still running or in the process of being cancelled!", "Advanced PortChecker", MessageBoxButton.OK, MessageBoxImage.Error);

0 commit comments

Comments
 (0)