Prevent avoidable exceptions
- Issue MatterHackers/MCCentral#2147 Null reference exception due to missing SliceSettingsOrganizer keys
This commit is contained in:
parent
7056e138ed
commit
8f87fd66c6
1 changed files with 5 additions and 14 deletions
|
|
@ -889,24 +889,15 @@ namespace MatterHackers.MatterControl.SlicerConfiguration
|
|||
|
||||
foreach (var keyValue in this.BaseLayer)
|
||||
{
|
||||
try
|
||||
// Add key/value to accumulating string for hash
|
||||
SliceSettingData data = SliceSettingsOrganizer.Instance.GetSettingsData(keyValue.Key);
|
||||
if (data?.RebuildGCodeOnChange == true)
|
||||
{
|
||||
SliceSettingData data = SliceSettingsOrganizer.Instance.GetSettingsData(keyValue.Key);
|
||||
if (data.RebuildGCodeOnChange)
|
||||
{
|
||||
string activeValue = GetValue(keyValue.Key);
|
||||
bigStringForHashCode.Append(keyValue.Key);
|
||||
bigStringForHashCode.Append(activeValue);
|
||||
}
|
||||
}
|
||||
catch // no need to die if we find a setting we don't know
|
||||
{
|
||||
|
||||
bigStringForHashCode.Append(keyValue.Key);
|
||||
bigStringForHashCode.Append(this.GetValue(keyValue.Key));
|
||||
}
|
||||
}
|
||||
|
||||
string value = bigStringForHashCode.ToString();
|
||||
|
||||
return agg_basics.ComputeHash(bigStringForHashCode.ToString());
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue