Skip to content
This repository was archived by the owner on May 19, 2021. It is now read-only.

Commit f1805a8

Browse files
committed
Fail gracefully with an error message if the ProjectVersion.txt file is corrupt. This also enables the Launcher to list all other projects even if some are corrupt. Before this patch it halted with an exception.
1 parent 90e04b7 commit f1805a8

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

UnityLauncher/Form1.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -146,12 +146,12 @@ string GetProjectVersion(string path)
146146
}
147147
else
148148
{
149-
throw new InvalidDataException("Cannot find m_EditorVersion:" + dd);
149+
MessageBox.Show("Cannot find m_EditorVersion in '" + versionPath + "'.\n\nFile Content:\n" + string.Join("\n", data).ToString());
150150
}
151151
}
152152
else
153153
{
154-
throw new InvalidDataException("invalid projectversion data:" + data.ToString());
154+
MessageBox.Show("Invalid projectversion data found in '" + versionPath + "'.\n\nFile Content:\n" + string.Join("\n", data).ToString());
155155
}
156156
}
157157
}

0 commit comments

Comments
 (0)