Skip to content

Commit b1edafe

Browse files
committed
Fix possible exception on download failure & map list line ending bug
1 parent 2ad772b commit b1edafe

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

MapDownloader/FrmMain.cs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ private void btnMain_Click_Download(object sender, EventArgs e)
9999

100100
foreach (string rawMap in mapList)
101101
{
102-
string map = rawMap.Replace("\n", "");
102+
string map = rawMap.Replace("\r\n", "").Replace("\n", "");
103103

104104
if (!map.Equals(""))
105105
{
@@ -213,7 +213,10 @@ private async void DownloadFinished(object sender, AsyncCompletedEventArgs e)
213213
}
214214

215215
prgDownload.PerformStep();
216-
compressedFile.Delete();
216+
217+
if (compressedFile.Exists)
218+
compressedFile.Delete();
219+
217220
Download();
218221
}
219222

MapDownloader/Global.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ namespace MapDownloader
66
{
77
public static class Global
88
{
9-
public static string version = "2.0";
9+
public static string version = "2.0.1";
1010
public static string fastdlUrl = "";
1111
public static string maplistUrl = "";
1212
public static string appID = "";

0 commit comments

Comments
 (0)