Skip to content

Commit

Permalink
Fix for issue RomRaider#20 on the github list. No refactoring, and si…
Browse files Browse the repository at this point in the history
…nce 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
  • Loading branch information
lizzardo authored and Fred Cooke committed Dec 31, 2012
1 parent 9ceb701 commit 147f433
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/com/romraider/logger/ecu/EcuLogger.java
Expand Up @@ -1392,8 +1392,11 @@ private void saveSettings() {
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));
Expand Down

0 comments on commit 147f433

Please sign in to comment.