Skip to content

Commit da780f0

Browse files
committed
Fixed crash on first start when imported_versions/ doesn't yet exist
1 parent abdda44 commit da780f0

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

MCLauncher/VersionList.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ private void ParseList(JArray data, bool isCache) {
5454
}
5555

5656
public async Task LoadImported() {
57-
string[] subdirectoryEntries = await Task.Run(() => Directory.GetDirectories(_importedDirectory));
57+
string[] subdirectoryEntries = await Task.Run(() => Directory.Exists(_importedDirectory) ? Directory.GetDirectories(_importedDirectory) : Array.Empty<string>());
5858
foreach (string subdirectory in subdirectoryEntries) {
5959
AddEntry(Path.GetFileName(subdirectory), subdirectory);
6060
}

0 commit comments

Comments
 (0)