Skip to content

Commit 9571f13

Browse files
committed
Fix crash when downloading Flashpoint to invalid path
1 parent 0b4e705 commit 9571f13

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

src/Common.cs

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -335,8 +335,18 @@ public static void DeleteFileAndDirectories(string file)
335335
// Checks if specified Flashpoint destination path is valid, and optionally updates its respective textbox
336336
public static bool VerifyDestinationPath(string path, bool updateText)
337337
{
338-
string errorPath;
338+
if (!Path.IsPathRooted(path))
339+
{
340+
MessageBox.Show(
341+
$"The specified directory is not valid! Choose a different folder.",
342+
"Error", MessageBoxButtons.OK, MessageBoxIcon.Error
343+
);
339344

345+
return false;
346+
}
347+
348+
string errorPath;
349+
340350
if (path.StartsWith(Environment.ExpandEnvironmentVariables("%ProgramW6432%"))
341351
|| path.StartsWith(Environment.GetFolderPath(Environment.SpecialFolder.ProgramFilesX86)))
342352
{

0 commit comments

Comments
 (0)