From 28e12dad0fd8bee776a8f3f2add9fdc455cc98c5 Mon Sep 17 00:00:00 2001 From: riperiperi Date: Sun, 3 May 2020 19:42:17 +0100 Subject: [PATCH] Fix issues causing keyboard profiles to throw errors on load. (#1206) * Fix issues causing keyboard profiles to throw errors on load. * Re-add space before the using aliases --- Ryujinx/Ui/ControllerWindow.cs | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/Ryujinx/Ui/ControllerWindow.cs b/Ryujinx/Ui/ControllerWindow.cs index 06a78ecec..47d6db196 100644 --- a/Ryujinx/Ui/ControllerWindow.cs +++ b/Ryujinx/Ui/ControllerWindow.cs @@ -1,17 +1,17 @@ using Gtk; using OpenTK.Input; +using Ryujinx.Common.Configuration.Hid; +using Ryujinx.Common.Utilities; +using Ryujinx.Configuration; +using Ryujinx.HLE.FileSystem; using System; using System.IO; using System.Reflection; +using System.Text.Json; using System.Threading; -using Ryujinx.Configuration; -using Ryujinx.Common.Configuration.Hid; -using Ryujinx.Common.Utilities; -using Ryujinx.HLE.FileSystem; using GUI = Gtk.Builder.ObjectAttribute; using Key = Ryujinx.Configuration.Hid.Key; -using Ryujinx.Common.Logging; namespace Ryujinx.Ui { @@ -821,20 +821,23 @@ namespace Ryujinx.Ui return; } - using (Stream stream = File.OpenRead(path)) + try { - try + using (Stream stream = File.OpenRead(path)) { config = JsonHelper.Deserialize(stream); } - catch (ArgumentException) + } + catch (JsonException) + { + try { - try + using (Stream stream = File.OpenRead(path)) { config = JsonHelper.Deserialize(stream); } - catch { } } + catch { } } }