fix: VersionNotFoundException

This commit is contained in:
huanghongxun 2020-04-29 21:56:05 +08:00
parent 8997895a82
commit 8e9f706d37

View File

@ -124,6 +124,14 @@ public class VersionPage extends Control implements DecoratorPage {
}
public void loadVersion(String version, Profile profile) {
// If we jumped to game list page and deleted this version
// and back to this page, we should return to main page.
if (!this.profile.getRepository().isLoaded() ||
!this.profile.getRepository().hasVersion(version)) {
Platform.runLater(() -> fireEvent(new PageCloseEvent()));
return;
}
setVersion(version, profile);
preferredVersionName = version;
listView.getSelectionModel().select(version);