Skip to content

Commit 57f786e

Browse files
committed
Merge #3863 Fix exception at startup w/o default game inst
2 parents 1748b7d + d219020 commit 57f786e

3 files changed

Lines changed: 14 additions & 8 deletions

File tree

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,9 @@ All notable changes to this project will be documented in this file.
44

55
## v1.33.1
66

7+
### Bugfixes
78

9+
- [GUI] Fix exception at startup w/o default game inst (#3863 by: HebaruSan)
810

911
## v1.33.0 (Lagrange)
1012

GUI/Main/Main.cs

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -255,13 +255,6 @@ protected override void OnShown(EventArgs e)
255255
} while (CurrentInstance == null);
256256
// We can only reach this point if CurrentInstance is not null
257257
// AND we acquired the lock for it successfully
258-
if (!configuration.CheckForUpdatesOnLaunchNoNag && AutoUpdate.CanUpdate)
259-
{
260-
log.Debug("Asking user if they wish for auto-updates");
261-
if (new AskUserForAutoUpdatesDialog().ShowDialog(this) == DialogResult.OK)
262-
configuration.CheckForUpdatesOnLaunch = true;
263-
configuration.CheckForUpdatesOnLaunchNoNag = true;
264-
}
265258
evt.Result = true;
266259
},
267260
(sender, evt) =>
@@ -390,6 +383,14 @@ private void CurrentInstanceUpdated(bool allowRepoUpdate)
390383
Path.Combine(CurrentInstance.CkanDir(), "GUIConfig.xml"),
391384
CurrentInstance.game);
392385

386+
if (!configuration.CheckForUpdatesOnLaunchNoNag && AutoUpdate.CanUpdate)
387+
{
388+
log.Debug("Asking user if they wish for auto-updates");
389+
if (new AskUserForAutoUpdatesDialog().ShowDialog(this) == DialogResult.OK)
390+
configuration.CheckForUpdatesOnLaunch = true;
391+
configuration.CheckForUpdatesOnLaunchNoNag = true;
392+
}
393+
393394
var pluginsPath = Path.Combine(CurrentInstance.CkanDir(), "Plugins");
394395
if (!Directory.Exists(pluginsPath))
395396
Directory.CreateDirectory(pluginsPath);

GUI/Model/GUIConfiguration.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,10 @@ public Point WindowLoc
9999

100100
public void Save()
101101
{
102-
SaveConfiguration(this);
102+
if (!string.IsNullOrEmpty(path))
103+
{
104+
SaveConfiguration(this);
105+
}
103106
}
104107

105108
public static GUIConfiguration LoadOrCreateConfiguration(string path, IGame game)

0 commit comments

Comments
 (0)