Skip to content
Snippets Groups Projects
Commit 0bfa08a7 authored by Niko Ehrenfeuchter's avatar Niko Ehrenfeuchter :keyboard:
Browse files

Prevent tray app from submitting entire drives

Fixes #47
parent 3279934d
No related branches found
No related tags found
No related merge requests found
......@@ -295,6 +295,7 @@ namespace ATxTray
return;
_selectedDir = new DirectoryInfo(dirDialog.FileName);
Log.Debug($"Selected path from folder picker: [{_selectedDir.Name}]");
var drive = dirDialog.FileName.Substring(0, 3);
if (drive != _config.SourceDrive) {
MessageBox.Show($@"The selected directory '{_selectedDir}' is required to be on " +
......@@ -303,6 +304,12 @@ namespace ATxTray
return;
}
if (_selectedDir.Name.Length <= 3) {
MessageBox.Show($"Submitting entire drives ({_selectedDir.Name}) is not allowed!",
"Invalid selection", MessageBoxButtons.OK, MessageBoxIcon.Error);
return;
}
try {
NewTxConfirmationDialog();
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment