Skip to content

Commit

Permalink
Fixes Issue #379 NullReferenceException being thrown on First Run
Browse files Browse the repository at this point in the history
  • Loading branch information
jimradford committed Sep 25, 2015
1 parent af67fa4 commit ab7a65a
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
5 changes: 4 additions & 1 deletion SuperPutty/SessionTreeview.cs
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,10 @@ public SessionTreeview(DockPanel dockPanel)
m_DockPanel = dockPanel;
InitializeComponent();
this.treeView1.TreeViewNodeSorter = this;
this.treeView1.ImageList = SuperPuTTY.Images;
if (SuperPuTTY.Images != null)
{
this.treeView1.ImageList = SuperPuTTY.Images;
}
this.ApplySettings();

// populate sessions in the treeview from the registry
Expand Down
9 changes: 5 additions & 4 deletions SuperPutty/SuperPuTTY.cs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,9 @@ public static void Initialize(string[] args)
{
Log.InfoFormat(
"Initializing. Version={0}, UserSettings={1}, SettingsFolder={2}",
Version, Settings.SettingsFilePath, Settings.SettingsFolder);
Version, Settings.SettingsFilePath, Settings.SettingsFolder);

Images = LoadImageList("default");

if (!SuperPuTTY.IsFirstRun)
{
Expand All @@ -54,10 +56,9 @@ public static void Initialize(string[] args)
}
}

// load data
// load data
LoadLayouts();
LoadSessions();
Images = LoadImageList("default");
LoadSessions();

// determine starting layout, if any. CLI has priority
if (CommandLine.IsValid)
Expand Down

0 comments on commit ab7a65a

Please sign in to comment.