if (null != curfile && curfile.length() > 0) {
if (curfile != null && curfile.length() > 0) {
    private void boardSaveAsImage() {        JFileChooser fc = new JFileChooser(".");        fc.setLocation(frame.getLocation().x + 150, frame.getLocation().y + 100);        fc.setDialogTitle(Messages.getString("BoardEditor.saveAsImage"));        fc.setFileFilter(new FileFilter() {            public boolean accept(File dir) {                return (null != dir.getName() && dir.getName().endsWith(".png")); //$NON-NLS-1$            }            public String getDescription() {                return ".png";            }        });        // Default to the board's name (if it has one).        String fileName;        if (null != curfile && curfile.length() > 0) {            fileName = curfile.getName().toUpperCase();            if (fileName.endsWith(".BOARD")) { //$NON-NLS-1$                int length = fileName.length();                fileName = fileName.substring(0, length - 6);            }            fileName = fileName.toLowerCase() + ".png"; //$NON-NLS-1$            fc.setSelectedFile(new File(fileName));        }        int returnVal = fc.showSaveDialog(frame);        if (returnVal != JFileChooser.APPROVE_OPTION || fc.getSelectedFile() == null) {            // I want a file, y'know!            return;        }        curfileImage = fc.getSelectedFile();        // make sure the file ends in png        if (!curfileImage.getName().toLowerCase().endsWith(".png")) { //$NON-NLS-1$            try {                curfileImage = new File(curfileImage.getCanonicalPath() + ".png"); //$NON-NLS-1$            } catch (IOException ie) {                //failure!                return;            }        }        frame.setTitle(Messages.getString("BoardEditor.title0") + curfileImage); //$NON-NLS-1$        boardSaveImage();    }