Fix bug where Exception is thrown when hitting cancel on JFileChooser.