Revision: 5168
http://sourceforge.net/p/jump-pilot/code/5168
Author: edso
Date: 2016-11-06 17:18:05 +0000 (Sun, 06 Nov 2016)
Log Message:
-----------
fix NPE during startup
java.lang.NullPointerException
at
org.openjump.core.ui.plugin.file.open.JFCWithEnterAction.getSelectedFile(JFCWithEnterAction.java:79)
at
com.sun.java.swing.plaf.windows.WindowsFileChooserUI.installComponents(WindowsFileChooserUI.java:439)
at
...
Modified Paths:
--------------
core/trunk/src/org/openjump/core/ui/plugin/file/open/JFCWithEnterAction.java
Modified:
core/trunk/src/org/openjump/core/ui/plugin/file/open/JFCWithEnterAction.java
===================================================================
---
core/trunk/src/org/openjump/core/ui/plugin/file/open/JFCWithEnterAction.java
2016-11-06 15:16:45 UTC (rev 5167)
+++
core/trunk/src/org/openjump/core/ui/plugin/file/open/JFCWithEnterAction.java
2016-11-06 17:18:05 UTC (rev 5168)
@@ -51,7 +51,9 @@
* nothing when a file is selected" [Jon Aquino]
*/
public File getSelectedFile() {
- File file = super.getSelectedFile();
+ File file;
+
+ file = super.getSelectedFile();
if (file != null)
return file;
@@ -74,11 +76,12 @@
try {
Method getFileName = getUI().getClass().getDeclaredMethod("getFileName");
String filename = (String) getFileName.invoke(getUI());
- if (!filename.isEmpty())
+ if (filename != null && !filename.isEmpty()) {
file = new File(filename);
if (file.getParentFile() == null)
file = new File(getCurrentDirectory(), filename);
return file;
+ }
} catch (Exception e) {
Logger.error(e);
}
------------------------------------------------------------------------------
Developer Access Program for Intel Xeon Phi Processors
Access to Intel Xeon Phi processor-based developer platforms.
With one year of Intel Parallel Studio XE.
Training and support from Colfax.
Order your platform today. http://sdm.link/xeonphi
_______________________________________________
Jump-pilot-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jump-pilot-devel