Skip to content

Commit

Permalink
Ignore splitter exceptions
Browse files Browse the repository at this point in the history
  • Loading branch information
HebaruSan committed Apr 25, 2018
1 parent e5c92de commit 1ca841b
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 4 deletions.
10 changes: 9 additions & 1 deletion GUI/Main.cs
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,15 @@ protected override void OnLoad(EventArgs e)
Location = configuration.WindowLoc;
Size = configuration.WindowSize;
WindowState = configuration.IsWindowMaximised ? FormWindowState.Maximized : FormWindowState.Normal;
splitContainer1.SplitterDistance = configuration.PanelPosition;
try
{
splitContainer1.SplitterDistance = configuration.PanelPosition;
}
catch
{
// SplitContainer is mis-designed to throw exceptions
// if the min/max limits are exceeded rather than simply obeying them.
}
ModInfoTabControl.ModMetaSplitPosition = configuration.ModInfoPosition;

if (!configuration.CheckForUpdatesOnLaunchNoNag && AutoUpdate.CanUpdate)
Expand Down
4 changes: 2 additions & 2 deletions GUI/MainModInfo.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 9 additions & 1 deletion GUI/MainModInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,15 @@ public int ModMetaSplitPosition
}
set
{
this.splitContainer2.SplitterDistance = value;
try
{
this.splitContainer2.SplitterDistance = value;
}
catch
{
// SplitContainer is mis-designed to throw exceptions
// if the min/max limits are exceeded rather than simply obeying them.
}
}
}

Expand Down

0 comments on commit 1ca841b

Please sign in to comment.