From 1e3fd0eb38d89900c6f4afa0fd6e72ccb957f7b5 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Thu, 5 Oct 2023 12:50:42 +0900 Subject: [PATCH] Fix a few potential nulls --- PerformanceCalculatorGUI/Components/ExtendedProfileScore.cs | 2 +- PerformanceCalculatorGUI/Configuration/SettingsManager.cs | 2 +- PerformanceCalculatorGUI/Screens/SimulateScreen.cs | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/PerformanceCalculatorGUI/Components/ExtendedProfileScore.cs b/PerformanceCalculatorGUI/Components/ExtendedProfileScore.cs index f21b62cc9..e8aacd4e2 100644 --- a/PerformanceCalculatorGUI/Components/ExtendedProfileScore.cs +++ b/PerformanceCalculatorGUI/Components/ExtendedProfileScore.cs @@ -282,7 +282,7 @@ private void load(RulesetStore rulesets) { var ruleset = rulesets.GetRuleset(Score.SoloScore.RulesetID) ?? throw new InvalidOperationException(); - return new ModIcon(ruleset.CreateInstance().CreateModFromAcronym(mod.Acronym)) + return new ModIcon(ruleset.CreateInstance().CreateModFromAcronym(mod.Acronym)!) { Scale = new Vector2(0.35f) }; diff --git a/PerformanceCalculatorGUI/Configuration/SettingsManager.cs b/PerformanceCalculatorGUI/Configuration/SettingsManager.cs index b8cc41c3c..19e0447c0 100644 --- a/PerformanceCalculatorGUI/Configuration/SettingsManager.cs +++ b/PerformanceCalculatorGUI/Configuration/SettingsManager.cs @@ -30,7 +30,7 @@ protected override void InitialiseDefaults() SetDefault(Settings.ClientId, string.Empty); SetDefault(Settings.ClientSecret, string.Empty); SetDefault(Settings.DefaultPath, Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location)); - SetDefault(Settings.CachePath, Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), "cache")); + SetDefault(Settings.CachePath, Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location)!, "cache")); } } } diff --git a/PerformanceCalculatorGUI/Screens/SimulateScreen.cs b/PerformanceCalculatorGUI/Screens/SimulateScreen.cs index 100d0fc9d..59172ba66 100644 --- a/PerformanceCalculatorGUI/Screens/SimulateScreen.cs +++ b/PerformanceCalculatorGUI/Screens/SimulateScreen.cs @@ -623,7 +623,7 @@ private void calculatePerformance() var beatmap = working.GetPlayableBeatmap(ruleset.Value, appliedMods.Value); var accuracy = accuracyTextBox.Value.Value / 100.0; - Dictionary statistics = null; + Dictionary statistics = new Dictionary(); if (ruleset.Value.OnlineID != -1) {