mirror of
https://git.ryujinx.app/projects/Kenji-NX.git
synced 2026-11-19 17:21:15 +01:00
misc: chore: Fix numerous NullReferenceExceptions, InvalidOperationExceptions
This commit is contained in:
1 parent
a90db3464d
commit
d2a532f971
90 files changed
+667
-533
No files matched your search
@@ -120,7 +120,7 @@ namespace Ryujinx.Ava.UI.Windows
|
||||
}
|
||||
}
|
||||
|
||||
Directory.CreateDirectory(Path.GetDirectoryName(_enabledCheatsPath));
|
||||
Directory.CreateDirectory(Path.GetDirectoryName(_enabledCheatsPath) ?? string.Empty);
|
||||
|
||||
File.WriteAllLines(_enabledCheatsPath, enabledCheats);
|
||||
|
||||
|
||||
@@ -53,12 +53,12 @@ namespace Ryujinx.Ava.UI.Windows
|
||||
private void SaveAndClose(object sender, RoutedEventArgs routedEventArgs)
|
||||
{
|
||||
ViewModel.Save();
|
||||
((ContentDialog)Parent).Hide();
|
||||
((ContentDialog)Parent)?.Hide();
|
||||
}
|
||||
|
||||
private void Close(object sender, RoutedEventArgs e)
|
||||
{
|
||||
((ContentDialog)Parent).Hide();
|
||||
((ContentDialog)Parent)?.Hide();
|
||||
}
|
||||
|
||||
private void RemoveDLC(object sender, RoutedEventArgs e)
|
||||
|
||||
@@ -494,7 +494,10 @@ namespace Ryujinx.Ava.UI.Windows
|
||||
/// <summary>
|
||||
/// Subscribe to the ColorValuesChanged event
|
||||
/// </summary>
|
||||
PlatformSettings.ColorValuesChanged += OnPlatformColorValuesChanged;
|
||||
if (PlatformSettings != null)
|
||||
{
|
||||
PlatformSettings.ColorValuesChanged += OnPlatformColorValuesChanged;
|
||||
}
|
||||
|
||||
ViewModel.Initialize(
|
||||
ContentManager,
|
||||
@@ -578,7 +581,7 @@ namespace Ryujinx.Ava.UI.Windows
|
||||
var volumeSplitButton = sender as ToggleSplitButton;
|
||||
if (ViewModel.IsGameRunning)
|
||||
{
|
||||
if (!volumeSplitButton.IsChecked)
|
||||
if (volumeSplitButton is not { IsChecked: true })
|
||||
{
|
||||
ViewModel.AppHost.Device.SetVolume(ViewModel.VolumeBeforeMute);
|
||||
}
|
||||
|
||||
@@ -53,12 +53,12 @@ namespace Ryujinx.Ava.UI.Windows
|
||||
private void SaveAndClose(object sender, RoutedEventArgs e)
|
||||
{
|
||||
ViewModel.Save();
|
||||
((ContentDialog)Parent).Hide();
|
||||
((ContentDialog)Parent)?.Hide();
|
||||
}
|
||||
|
||||
private void Close(object sender, RoutedEventArgs e)
|
||||
{
|
||||
((ContentDialog)Parent).Hide();
|
||||
((ContentDialog)Parent)?.Hide();
|
||||
}
|
||||
|
||||
private async void DeleteMod(object sender, RoutedEventArgs e)
|
||||
|
||||
@@ -50,14 +50,14 @@ namespace Ryujinx.Ava.UI.Windows
|
||||
|
||||
private void Close(object sender, RoutedEventArgs e)
|
||||
{
|
||||
((ContentDialog)Parent).Hide();
|
||||
((ContentDialog)Parent)?.Hide();
|
||||
}
|
||||
|
||||
public void Save(object sender, RoutedEventArgs e)
|
||||
{
|
||||
ViewModel.Save();
|
||||
|
||||
((ContentDialog)Parent).Hide();
|
||||
((ContentDialog)Parent)?.Hide();
|
||||
}
|
||||
|
||||
private void OpenLocation(object sender, RoutedEventArgs e)
|
||||
|
||||
@@ -59,7 +59,7 @@ namespace Ryujinx.Ava.UI.Windows
|
||||
|
||||
private void Close(object sender, RoutedEventArgs e)
|
||||
{
|
||||
((ContentDialog)Parent).Hide();
|
||||
((ContentDialog)Parent)?.Hide();
|
||||
}
|
||||
|
||||
private void Cancel(Object sender, RoutedEventArgs e)
|
||||
|
||||
Reference in new issue
Block a user