Added handling for error that occurred when deleting the profile of the active printer.
This commit is contained in:
parent
9445266477
commit
484da4085c
1 changed files with 8 additions and 5 deletions
|
|
@ -98,17 +98,20 @@ namespace MatterHackers.MatterControl
|
|||
|
||||
void ValidateQualitySettings()
|
||||
{
|
||||
int index = activePrinter.QualityCollectionId;
|
||||
SliceSettingsCollection collection = DataStorage.Datastore.Instance.dbSQLite.Table<DataStorage.SliceSettingsCollection>().Where(v => v.Id == index).Take(1).FirstOrDefault();
|
||||
if (collection == null)
|
||||
if (activePrinter != null)
|
||||
{
|
||||
ActivePrinterProfile.Instance.ActiveQualitySettingsID = 0;
|
||||
int index = activePrinter.QualityCollectionId;
|
||||
SliceSettingsCollection collection = DataStorage.Datastore.Instance.dbSQLite.Table<DataStorage.SliceSettingsCollection>().Where(v => v.Id == index).Take(1).FirstOrDefault();
|
||||
if (collection == null)
|
||||
{
|
||||
ActivePrinterProfile.Instance.ActiveQualitySettingsID = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void ValidateMaterialSettings()
|
||||
{
|
||||
if (activePrinter.MaterialCollectionIds != null)
|
||||
if (activePrinter != null && activePrinter.MaterialCollectionIds != null)
|
||||
{
|
||||
string[] activeMaterialPresets = activePrinter.MaterialCollectionIds.Split(',');
|
||||
for (int i = 0; i < activeMaterialPresets.Count(); i++)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue