mirror of
https://git.ryujinx.app/projects/Kenji-NX.git
synced 2026-09-30 08:58:05 +02:00
misc: Tweak NullReferenceException fixes
This commit is contained in:
@@ -525,16 +525,16 @@ namespace Ryujinx.Ava.UI.ViewModels.Input
|
||||
{
|
||||
ProfilesList.Clear();
|
||||
|
||||
string basePath = GetProfileBasePath() ?? string.Empty;
|
||||
string basePath = GetProfileBasePath();
|
||||
|
||||
if (!Directory.Exists(basePath))
|
||||
{
|
||||
Directory.CreateDirectory(basePath);
|
||||
Directory.CreateDirectory(basePath ?? string.Empty);
|
||||
}
|
||||
|
||||
ProfilesList.Add((LocaleManager.Instance[LocaleKeys.ControllerSettingsProfileDefault]));
|
||||
|
||||
foreach (string profile in Directory.GetFiles(basePath, "*.json", SearchOption.AllDirectories))
|
||||
foreach (string profile in Directory.GetFiles(basePath ?? string.Empty, "*.json", SearchOption.AllDirectories))
|
||||
{
|
||||
ProfilesList.Add(Path.GetFileNameWithoutExtension(profile));
|
||||
}
|
||||
|
||||
@@ -1555,11 +1555,11 @@ namespace Ryujinx.Ava.UI.ViewModels
|
||||
|
||||
private void Update_StatusBar(object sender, StatusUpdatedEventArgs args)
|
||||
{
|
||||
if (ShowMenuAndStatusBar && !ShowLoadProgress)
|
||||
if (ShowMenuAndStatusBar && !ShowLoadProgress && Application.Current != null)
|
||||
{
|
||||
Dispatcher.UIThread.InvokeAsync(() =>
|
||||
{
|
||||
Application.Current!.Styles.TryGetResource(args.VSyncMode,
|
||||
Application.Current.Styles.TryGetResource(args.VSyncMode,
|
||||
Application.Current.ActualThemeVariant,
|
||||
out object color);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user