MakeSelectedProfileNullable

This commit is contained in:
Polaris_Light 2023-11-16 09:59:56 +08:00
parent a97096cddf
commit 49dec51588

View file

@ -581,7 +581,7 @@ namespace MinecraftClient.Protocol
ConsoleIO.WriteLine(Translations.mcc_select_player); ConsoleIO.WriteLine(Translations.mcc_select_player);
string selectedPlayer = ConsoleIO.ReadLine(); string selectedPlayer = ConsoleIO.ReadLine();
ConsoleIO.WriteLine(Translations.mcc_selected_player + selectedPlayer); ConsoleIO.WriteLine(Translations.mcc_selected_player + selectedPlayer);
Json.JSONData selectedProfile = null; Json.JSONData? selectedProfile = null;
foreach (Json.JSONData profile in loginResponse.Properties["availableProfiles"].DataArray) foreach (Json.JSONData profile in loginResponse.Properties["availableProfiles"].DataArray)
{ {
selectedProfile = profile.Properties["name"].StringValue == selectedPlayer ? profile : selectedProfile; selectedProfile = profile.Properties["name"].StringValue == selectedPlayer ? profile : selectedProfile;