Skip to content

Commit db6a7b3

Browse files
author
Gabriel Einsdorf
committed
Add backwards compatibility safeguard to the columncreation model.
1 parent 75f0b59 commit db6a7b3

File tree

1 file changed

+19
-2
lines changed

1 file changed

+19
-2
lines changed

org.knime.knip.ilastik/src/org/knime/knip/ilastik/nodes/headless/IlastikHeadlessNodeModel.java

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -496,7 +496,16 @@ protected void saveSettingsTo(final NodeSettingsWO settings) {
496496
protected void validateSettings(final NodeSettingsRO settings) throws InvalidSettingsException {
497497
m_pathToIlastikProjectFileModel.validateSettings(settings);
498498
m_srcImgCol.validateSettings(settings);
499-
m_colCreationModeModel.validateSettings(settings);
499+
try {
500+
m_colCreationModeModel.validateSettings(settings);
501+
} catch (InvalidSettingsException e) {
502+
if (("String for key \"colCreationMode\" not found.").equals(e.getMessage())) {
503+
// Ignore missing colCreationMode settings model for backwards compatibility.
504+
} else {
505+
throw e;
506+
}
507+
}
508+
500509
}
501510

502511
/**
@@ -506,7 +515,15 @@ protected void validateSettings(final NodeSettingsRO settings) throws InvalidSet
506515
protected void loadValidatedSettingsFrom(final NodeSettingsRO settings) throws InvalidSettingsException {
507516
m_pathToIlastikProjectFileModel.loadSettingsFrom(settings);
508517
m_srcImgCol.loadSettingsFrom(settings);
509-
m_colCreationModeModel.loadSettingsFrom(settings);
518+
try {
519+
m_colCreationModeModel.loadSettingsFrom(settings);
520+
} catch (InvalidSettingsException e) {
521+
if (("String for key \"colCreationMode\" not found.").equals(e.getMessage())) {
522+
// Ignore missing colCreationMode settings model for backwards compatibility.
523+
} else {
524+
throw e;
525+
}
526+
}
510527
}
511528

512529
/**

0 commit comments

Comments
 (0)