Enable nullability in Content.Client (#3257)

* Enable nullability in Content.Client

* Remove #nullable enable

* Merge fixes

* Remove Debug.Assert

* Merge fixes

* Fix build

* Fix build
This commit is contained in:
DrSmugleaf
2021-03-10 14:48:29 +01:00
committed by GitHub
parent 4f9bd4e802
commit 902aa128c2
270 changed files with 1774 additions and 1550 deletions

View File

@@ -173,9 +173,9 @@ namespace Content.Client.UserInterface
}
_createNewCharacterButton.ToolTip =
$"A maximum of {_preferencesManager.Settings.MaxCharacterSlots} characters are allowed.";
$"A maximum of {_preferencesManager.Settings!.MaxCharacterSlots} characters are allowed.";
foreach (var (slot, character) in _preferencesManager.Preferences.Characters)
foreach (var (slot, character) in _preferencesManager.Preferences!.Characters)
{
if (character is null)
{
@@ -228,7 +228,7 @@ namespace Content.Client.UserInterface
LobbyCharacterPreviewPanel.GiveDummyJobClothes(_previewDummy, humanoid);
}
var isSelectedCharacter = profile == preferencesManager.Preferences.SelectedCharacter;
var isSelectedCharacter = profile == preferencesManager.Preferences?.SelectedCharacter;
if (isSelectedCharacter)
Pressed = true;
@@ -260,9 +260,9 @@ namespace Content.Client.UserInterface
Text = "Delete",
Visible = !isSelectedCharacter,
};
deleteButton.OnPressed += args =>
deleteButton.OnPressed += _ =>
{
Parent.RemoveChild(this);
Parent?.RemoveChild(this);
preferencesManager.DeleteCharacter(profile);
};
@@ -288,7 +288,7 @@ namespace Content.Client.UserInterface
return;
_previewDummy.Delete();
_previewDummy = null;
_previewDummy = null!;
}
}
}