From: <aki...@us...> - 2006-12-24 00:07:04
|
Revision: 1256 http://svn.sourceforge.net/gridarta/?rev=1256&view=rev Author: akirschbaum Date: 2006-12-23 16:07:05 -0800 (Sat, 23 Dec 2006) Log Message: ----------- Prevent possible use of null filename. Modified Paths: -------------- trunk/crossfire/src/cfeditor/CMainControl.java trunk/daimonin/src/daieditor/CMainControl.java Modified: trunk/crossfire/src/cfeditor/CMainControl.java =================================================================== --- trunk/crossfire/src/cfeditor/CMainControl.java 2006-12-23 23:46:46 UTC (rev 1255) +++ trunk/crossfire/src/cfeditor/CMainControl.java 2006-12-24 00:07:05 UTC (rev 1256) @@ -1172,13 +1172,12 @@ // there is no map open (should not happen due to disabled menus) ACTION_FACTORY.showMessageDialog(mainView, "createImgNoMap"); } else { - String filename = null; - try { - if (strImageDir == null) { - strImageDir = mapDir.getAbsolutePath(); - } + if (strImageDir == null) { + strImageDir = mapDir.getAbsolutePath(); + } - filename = strImageDir + File.separator + mapControl.getMapFileName() + ".png"; + String filename = strImageDir + File.separator + mapControl.getMapFileName() + ".png"; + try { final JFileChooser fileChooser = new JFileChooser(strImageDir); fileChooser.setDialogTitle("Save Image As"); fileChooser.setFileSelectionMode(JFileChooser.FILES_ONLY); Modified: trunk/daimonin/src/daieditor/CMainControl.java =================================================================== --- trunk/daimonin/src/daieditor/CMainControl.java 2006-12-23 23:46:46 UTC (rev 1255) +++ trunk/daimonin/src/daieditor/CMainControl.java 2006-12-24 00:07:05 UTC (rev 1256) @@ -1398,13 +1398,12 @@ // there is no map open (should not happen due to disabled menus) ACTION_FACTORY.showMessageDialog(mainView, "createImgNoMap"); } else { - String filename = null; - try { - if (strImageDir == null) { - strImageDir = mapDir.getAbsolutePath(); - } + if (strImageDir == null) { + strImageDir = mapDir.getAbsolutePath(); + } - filename = strImageDir + File.separator + mapControl.getMapFileName() + ".png"; + String filename = strImageDir + File.separator + mapControl.getMapFileName() + ".png"; + try { final JFileChooser fileChooser = new JFileChooser(strImageDir); fileChooser.setDialogTitle("Save Image As"); fileChooser.setFileSelectionMode(JFileChooser.FILES_ONLY); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |