misc: Tweak NullReferenceException fixes

This commit is contained in:
KeatonTheBot
2025-10-31 01:04:00 -05:00
parent e3ee28605d
commit a6c0eabf49
23 changed files with 143 additions and 128 deletions
+6 -2
View File
@@ -516,12 +516,16 @@ namespace Ryujinx.Ava.UI.Windows
ApplicationLibrary.ApplicationCountUpdated += ApplicationLibrary_ApplicationCountUpdated;
_appLibraryAppsSubscription?.Dispose();
_appLibraryAppsSubscription = ApplicationLibrary.Applications
if (SynchronizationContext.Current != null)
{
_appLibraryAppsSubscription = ApplicationLibrary.Applications
.Connect()
.ObserveOn(SynchronizationContext.Current)
.Bind(ViewModel.Applications)
.OnItemAdded(UpdateApplicationWithLdnData)
.Subscribe();
}
ApplicationLibrary.LdnGameDataReceived += ApplicationLibrary_LdnGameDataReceived;
ConfigurationState.Instance.Multiplayer.Mode.Event += (sender, evt) =>
@@ -581,7 +585,7 @@ namespace Ryujinx.Ava.UI.Windows
var volumeSplitButton = sender as ToggleSplitButton;
if (ViewModel.IsGameRunning)
{
if (volumeSplitButton is not { IsChecked: true })
if (volumeSplitButton is { IsChecked: false })
{
ViewModel.AppHost.Device.SetVolume(ViewModel.VolumeBeforeMute);
}