From 147f433c07a23282701e12d21c457200b9496440 Mon Sep 17 00:00:00 2001 From: lizzardo Date: Sun, 30 Dec 2012 14:09:57 -0800 Subject: [PATCH] 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 --- src/com/romraider/logger/ecu/EcuLogger.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/com/romraider/logger/ecu/EcuLogger.java b/src/com/romraider/logger/ecu/EcuLogger.java index 9b42b27c8..bd8270e5a 100644 --- a/src/com/romraider/logger/ecu/EcuLogger.java +++ b/src/com/romraider/logger/ecu/EcuLogger.java @@ -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));