mirror of
https://github.com/HMCL-dev/HMCL.git
synced 2025-09-16 15:26:27 -04:00
Fix displaying "null" in GameItem
This commit is contained in:
parent
0dd9dc6c17
commit
e7142e4032
@ -25,6 +25,7 @@ import org.jackhuang.hmcl.setting.Profile;
|
||||
import org.jackhuang.hmcl.ui.Controllers;
|
||||
import org.jackhuang.hmcl.ui.wizard.WizardController;
|
||||
import org.jackhuang.hmcl.ui.wizard.WizardProvider;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
@ -38,7 +39,7 @@ public final class UpdateInstallerWizardProvider implements WizardProvider {
|
||||
private final String libraryId;
|
||||
private final String oldLibraryVersion;
|
||||
|
||||
public UpdateInstallerWizardProvider(Profile profile, String gameVersion, Version version, String libraryId, String oldLibraryVersion) {
|
||||
public UpdateInstallerWizardProvider(@NotNull Profile profile, @NotNull String gameVersion, @NotNull Version version, @NotNull String libraryId, @NotNull String oldLibraryVersion) {
|
||||
this.profile = profile;
|
||||
this.gameVersion = gameVersion;
|
||||
this.version = version;
|
||||
|
@ -60,10 +60,11 @@ public class GameItem extends Control {
|
||||
StringBuilder libraries = new StringBuilder(game);
|
||||
LibraryAnalyzer analyzer = LibraryAnalyzer.analyze(profile.getRepository().getResolvedPreservingPatchesVersion(id));
|
||||
analyzer.forEachLibrary((libraryId, libraryVersion) -> {
|
||||
if (I18n.hasKey("install.installer." + libraryId))
|
||||
libraries
|
||||
.append(", ").append(i18n("install.installer." + libraryId))
|
||||
.append(": ").append(modifyVersion(game, libraryVersion.replaceAll("(?i)" + libraryId, "")));
|
||||
if (I18n.hasKey("install.installer." + libraryId)) {
|
||||
libraries.append(", ").append(i18n("install.installer." + libraryId));
|
||||
if (libraryVersion != null)
|
||||
libraries.append(": ").append(modifyVersion("", libraryVersion.replaceAll("(?i)" + libraryId, "")));
|
||||
}
|
||||
});
|
||||
|
||||
subtitle.set(libraries.toString());
|
||||
|
Loading…
x
Reference in New Issue
Block a user