Check for a null directory coming back from preferences before using it

This commit is contained in:
2009-06-01 16:04:13 +00:00
parent 949986e056
commit a2622bf1e7
1 changed files with 5 additions and 1 deletions

View File

@ -170,7 +170,11 @@ public class SwingAppleCommander extends JFrame implements ActionListener {
*/
protected void openFile() {
JFileChooser jc = new JFileChooser();
jc.setCurrentDirectory(new File(userPreferences.getDiskImageDirectory()));
String pathName = userPreferences.getDiskImageDirectory();
if (null == pathName) {
pathName = ""; //$NON-NLS-1$
}
jc.setCurrentDirectory(new File(pathName));
EmulatorFileFilter ff = new EmulatorFileFilter();
jc.setFileFilter(ff);
int rc = jc.showDialog(this, textBundle.get("Open")); //$NON-NLS-1$