Skip to content

Commit

Permalink
Fixed regression NPEs on workbench when no input sources were present.
Browse files Browse the repository at this point in the history
  • Loading branch information
dweiss committed Feb 7, 2012
1 parent a6fe0a8 commit cc249b1
Showing 1 changed file with 18 additions and 9 deletions.
Expand Up @@ -628,15 +628,21 @@ private void createComponents(Composite parent)
displayEditorSet();

// Restore initial expansion state for groups.
if (state != null)
{
this.attributeGroups.setExpanded(state.sectionsExpansionState);
}
else
if (attributeGroups != null)
{
// Set the default expansion state.
this.attributeGroups.setExpanded(false);
this.attributeGroups.setExpanded(AttributeLevel.BASIC.toString(), true);
if (state != null)
{
if (state.sectionsExpansionState != null)
{
this.attributeGroups.setExpanded(state.sectionsExpansionState);
}
}
else
{
// Set the default expansion state.
this.attributeGroups.setExpanded(false);
this.attributeGroups.setExpanded(AttributeLevel.BASIC.toString(), true);
}
}
}

Expand Down Expand Up @@ -984,7 +990,10 @@ public void saveState(IMemento memento)
state.algorithmId = getAlgorithmId();
state.linkWithEditor = linkWithEditor;
state.attributes = attributes;
state.sectionsExpansionState = attributeGroups.getExpansionStates();

if (attributeGroups != null) {
state.sectionsExpansionState = attributeGroups.getExpansionStates();
}

try
{
Expand Down

0 comments on commit cc249b1

Please sign in to comment.