diff --git a/Common/KNARZhelper/DatabaseObjectTypes/TypeDescription.cs b/Common/KNARZhelper/DatabaseObjectTypes/TypeDescription.cs index c21de4fb5..a56043300 100644 --- a/Common/KNARZhelper/DatabaseObjectTypes/TypeDescription.cs +++ b/Common/KNARZhelper/DatabaseObjectTypes/TypeDescription.cs @@ -12,8 +12,8 @@ internal class TypeDescription : BaseStringType public override void EmptyFieldInGame(Game game) => API.Instance.MainView.UIDispatcher.Invoke(() => game.Description = default); - public override bool FieldInGameIsEmpty(Game game) => !game.Description.Trim().Any(); + public override bool FieldInGameIsEmpty(Game game) => !game?.Description?.Trim().Any() ?? true; - public override bool GameContainsValue(Game game, string value) => game.Description.RegExIsMatch(value); + public override bool GameContainsValue(Game game, string value) => value != null && (game?.Description?.RegExIsMatch(value) ?? false); } } \ No newline at end of file diff --git a/Generic/MetadataUtilities/Views/SettingsView.xaml b/Generic/MetadataUtilities/Views/SettingsView.xaml index 8139e6f0f..cc050be79 100644 --- a/Generic/MetadataUtilities/Views/SettingsView.xaml +++ b/Generic/MetadataUtilities/Views/SettingsView.xaml @@ -305,11 +305,11 @@