mirror of
https://git.ryujinx.app/projects/Kenji-NX.git
synced 2026-10-01 12:38:29 +02:00
misc: chore: Fix numerous NullReferenceExceptions, InvalidOperationExceptions
This commit is contained in:
@@ -111,7 +111,7 @@ namespace Ryujinx.Ava.UI.Controls
|
||||
viewModel.VirtualFileSystem,
|
||||
viewModel.SelectedApplication.IdString,
|
||||
viewModel.SelectedApplication.Name,
|
||||
viewModel.SelectedApplication.Path).ShowDialog(viewModel.TopLevel as Window);
|
||||
viewModel.SelectedApplication.Path).ShowDialog((Window)viewModel.TopLevel);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -396,9 +396,12 @@ namespace Ryujinx.Ava.UI.Controls
|
||||
viewModel.SelectedApplication.Name);
|
||||
|
||||
var iconFile = await result[0].CreateFileAsync(selectedApp.IdString + ".png");
|
||||
await using var fileStream = await iconFile.OpenWriteAsync();
|
||||
if (iconFile != null)
|
||||
{
|
||||
await using var fileStream = await iconFile.OpenWriteAsync();
|
||||
|
||||
fileStream.Write(selectedApp.Icon);
|
||||
fileStream.Write(selectedApp.Icon);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -37,7 +37,7 @@ namespace Ryujinx.Ava.UI.Controls
|
||||
|
||||
private void SearchBox_OnKeyUp(object sender, KeyEventArgs args)
|
||||
{
|
||||
(DataContext as MainWindowViewModel).SearchText = (sender as TextBox).Text;
|
||||
(DataContext as MainWindowViewModel).SearchText = (sender as TextBox)?.Text;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -38,7 +38,7 @@ namespace Ryujinx.Ava.UI.Controls
|
||||
|
||||
private void SearchBox_OnKeyUp(object sender, KeyEventArgs args)
|
||||
{
|
||||
(DataContext as MainWindowViewModel).SearchText = (sender as TextBox).Text;
|
||||
(DataContext as MainWindowViewModel).SearchText = (sender as TextBox)?.Text;
|
||||
}
|
||||
|
||||
private async void IdString_OnClick(object sender, RoutedEventArgs e)
|
||||
|
||||
Reference in New Issue
Block a user