Fix for issue #20 on the github list. No refactoring, and since it's on closing, refactoring seems unnecessary. All we're trying to do is save the divider location, so make sure there is one

- Check if the component is a JSplitPane before trying to cast as one
This commit is contained in:
lizzardo 2012-12-30 14:09:57 -08:00 committed by Fred Cooke
parent 9ceb701e48
commit 147f433c07
1 changed files with 5 additions and 2 deletions

View File

@ -1392,8 +1392,11 @@ public final class EcuLogger extends AbstractFrame implements MessageListener {
settings.setLoggerWindowLocation(getLocation());
if (settings.getLoggerParameterListState()) {
final Component c = tabbedPane.getSelectedComponent();
final JSplitPane sp = (JSplitPane) c.getComponentAt(100, 100);
settings.setLoggerDividerLocation(sp.getDividerLocation());
if (c instanceof JSplitPane) {
// Only save the divider location if there is one
final JSplitPane sp = (JSplitPane) c.getComponentAt(100, 100);
settings.setLoggerDividerLocation(sp.getDividerLocation());
}
}
settings.setLoggerSelectedTabIndex(tabbedPane.getSelectedIndex());
settings.setLoggerPluginPorts(getPluginPorts(externalDataSources));