Skip to content

Commit 6cadc38

Browse files
committed
Prevent a crash when accessing Preferences in Settings
1 parent 927dbd2 commit 6cadc38

File tree

2 files changed

+2
-6
lines changed

2 files changed

+2
-6
lines changed

Files/SettingsPages/Preferences.xaml.cs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ public Preferences()
2525
{
2626
this.InitializeComponent();
2727

28-
if (App.AppSettings != null)
28+
if (App.AppSettings != null && localSettings.Values["customLocationsSetting"] != null)
2929
{
3030
if (localSettings.Values["customLocationsSetting"].Equals(true))
3131
{
@@ -90,10 +90,6 @@ protected override void OnNavigatedTo(NavigationEventArgs e)
9090
{
9191
base.OnNavigatedTo(e);
9292

93-
var terminals = App.AppSettings.Terminals;
94-
95-
foreach (var terminal in terminals) App.AppSettings.Terminals.Add(terminal);
96-
9793
var terminalId = 1;
9894
if (localSettings.Values["terminal_id"] != null) terminalId = (int) localSettings.Values["terminal_id"];
9995

Files/View Models/SettingsViewModel.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,10 @@ public SettingsViewModel()
3131
DetectApplicationTheme();
3232
DetectDateTimeFormat();
3333
DetectSidebarOpacity();
34-
3534
DrivesManager = new DrivesManager();
3635

3736
foundDrives = DrivesManager.Drives;
37+
LoadTerminalApps();
3838
}
3939

4040
private void DetectSidebarOpacity()

0 commit comments

Comments
 (0)