summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoradrian-bowyer <adrian-bowyer>2010-08-13 17:03:53 +0000
committeradrian-bowyer <adrian-bowyer@cb376a5e-1013-0410-a455-b6b1f9ac8223>2010-08-13 17:03:53 +0000
commit04bbd18eb185866b07330fcd47204de9e3852f92 (patch)
tree090a61eb5f72e588c2eb86ec99ad7bdc229135aa
parentb7caee23a7ac85a4222cab822f437a9b776b28ec (diff)
downloadreprap-04bbd18eb185866b07330fcd47204de9e3852f92.tar.gz
reprap-04bbd18eb185866b07330fcd47204de9e3852f92.zip
Bug when null file was returned (i.e. user selected cancel) fixed.
git-svn-id: https://reprap.svn.sourceforge.net/svnroot/reprap@3709 cb376a5e-1013-0410-a455-b6b1f9ac8223
-rw-r--r--trunk/reprap/host/src/org/reprap/machines/GenericRepRap.java14
1 files changed, 11 insertions, 3 deletions
diff --git a/trunk/reprap/host/src/org/reprap/machines/GenericRepRap.java b/trunk/reprap/host/src/org/reprap/machines/GenericRepRap.java
index e738235d..e0c12037 100644
--- a/trunk/reprap/host/src/org/reprap/machines/GenericRepRap.java
+++ b/trunk/reprap/host/src/org/reprap/machines/GenericRepRap.java
@@ -1,7 +1,7 @@
package org.reprap.machines;
import java.io.IOException;
-
+import java.io.File;
import javax.swing.JCheckBoxMenuItem;
import javax.swing.JFrame;
import org.reprap.Attributes;
@@ -1164,7 +1164,11 @@ public abstract class GenericRepRap implements CartesianPrinter
{
gcodeLoaded = false;
stlLoaded = true;
- return org.reprap.Main.gui.onOpen("STL triangulation file", "stl", "").getName();
+ File f = org.reprap.Main.gui.onOpen("STL triangulation file", "stl", "");
+ if(f == null)
+ return "";
+ else
+ return f.getName();
}
/**
@@ -1175,7 +1179,11 @@ public abstract class GenericRepRap implements CartesianPrinter
{
gcodeLoaded = false;
stlLoaded = true;
- return org.reprap.Main.gui.onOpen("RFO multiple-object file", "rfo", "").getName();
+ File f = org.reprap.Main.gui.onOpen("RFO multiple-object file", "rfo", "");
+ if(f == null)
+ return "";
+ else
+ return f.getName();
}
/**