fix: fix 'new name' prompt when passing empty string

This fixes System.UnauthorizedAccessException by prompting new name again
This commit is contained in:
cuqmbr 2022-08-11 13:57:13 +03:00
parent c3fc536b17
commit 676ec839ac

View File

@ -80,8 +80,14 @@ class Program
if (String.IsNullOrEmpty(opt) || opt.ToLower() == "no" ||
opt.ToLower() == "n")
{
Console.Write("Enter a new name: ");
Console.Write("Enter a <new_name>[.kml]: ");
var name = Console.ReadLine();
if (String.IsNullOrEmpty(name))
{
continue;
}
outFile = new FileInfo(
Path.Join(outFile.DirectoryName, name));
continue;