Prevent frequently occurring exception during parse
This commit is contained in:
parent
6a84736f1f
commit
8a73db2ba0
1 changed files with 4 additions and 6 deletions
|
|
@ -271,14 +271,12 @@ namespace MatterHackers.MatterControl
|
|||
/// </summary>
|
||||
public void SwitchToPrinterThemeWithoutReloadEvent()
|
||||
{
|
||||
string activeThemeIndex = ActiveSliceSettings.Instance.ActiveValue("MatterControl.ActiveThemeIndex");
|
||||
|
||||
int themeIndex;
|
||||
try
|
||||
if (string.IsNullOrEmpty(activeThemeIndex) || !int.TryParse(activeThemeIndex, out themeIndex))
|
||||
{
|
||||
themeIndex = Convert.ToInt32(ActiveSliceSettings.Instance.ActiveValue("MatterControl.ActiveThemeIndex"));
|
||||
}
|
||||
catch
|
||||
{
|
||||
GuiWidget.BreakInDebugger();
|
||||
// Fall back to default theme if user settings are missing or invalid
|
||||
themeIndex = defaultThemeIndex;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue