diff --git a/src/main/java/DeepImageJ_Run.java b/src/main/java/DeepImageJ_Run.java index 6ee3525d..4d8d0bd9 100755 --- a/src/main/java/DeepImageJ_Run.java +++ b/src/main/java/DeepImageJ_Run.java @@ -1462,7 +1462,7 @@ public void actionPerformed(ActionEvent e) { // Do nothing } } - notNpy = !(imageName2.endsWith(".npy") || imageName2.endsWith(".npx") || imageName2.endsWith(".np")); + notNpy = imageName2 != null && !(imageName2.endsWith(".npy") || imageName2.endsWith(".npx") || imageName2.endsWith(".np")); if (!openTest && notNpy && imageName2 != null && new File(imageName2).isFile()) { try{ imp = IJ.openImage(imageName2);