Fixed NPE in GuiFileChooser if selected file is null

This commit is contained in:
CrushedPixel
2015-07-12 22:23:33 +02:00
parent ac3474f2bc
commit b0429fcf44

View File

@@ -62,8 +62,10 @@ public class GuiFileChooser extends GuiAdvancedButton {
fileDialog.setMode(save ? FileDialog.SAVE : FileDialog.LOAD);
fileDialog.setDirectory(selectedFile.getParentFile().getAbsolutePath());
fileDialog.setFile(selectedFile.getName());
if(selectedFile != null) {
fileDialog.setDirectory(selectedFile.getParentFile().getAbsolutePath());
fileDialog.setFile(selectedFile.getName());
}
fileDialog.setFilenameFilter(new FilenameFilter() {
@Override