@@ -131,12 +131,17 @@ private ArrayList<CSG> performOperation(List<CSG> csgList, CSGRemoteOperation op
131131 * Internal method to perform operations and handle request/response
132132 */
133133 private ArrayList <CSG > performOperation (List <CSG > csgList , CSGRemoteOperation operation ,List <Vector3d > points , PropertyStorage storage ) throws Exception {
134+ if (javafx .application .Platform .isFxApplicationThread ()) {
135+ RuntimeException runtimeException = new RuntimeException ("Network trafic can not run on UI thread" );
136+ runtimeException .printStackTrace ();
137+ throw runtimeException ;
138+ }
134139 ArrayList <CSG > back = null ;
135140 SSLSocket socket = (SSLSocket ) factory .createSocket (hostname , port );
136141 try {
137142 ObjectOutputStream oos = new ObjectOutputStream (socket .getOutputStream ());
138143 ObjectInputStream ois = new ObjectInputStream (socket .getInputStream ());
139- //System.out.println("Running Operation on server: " + hostname + " " + operation);
144+ //
140145 // Create and send request
141146
142147 ArrayList <CSG > toSend = new ArrayList <CSG >();
@@ -160,6 +165,10 @@ private ArrayList<CSG> performOperation(List<CSG> csgList, CSGRemoteOperation op
160165 // Return results as ArrayList
161166 back =new ArrayList <CSG >();
162167 for (CSG c :response .getCsgList ()) {
168+ if (c .getPolygons ().size ()==0 ) {
169+ System .out .println ("Running Operation on server: " + hostname + " " + operation );
170+ new RuntimeException ("Network CSG op resulted in no polygons here " ).printStackTrace ();
171+ }
163172 CSG historySync = CSG .fromPolygons (c .getPolygons ());
164173 back .add ( historySync );
165174 for (CSG s :csgList ) {
@@ -192,6 +201,8 @@ public static void close() {
192201 }
193202
194203 public static boolean isRunning () {
204+ if (javafx .application .Platform .isFxApplicationThread ())
205+ return false ;// do not run operation on UI thread
195206 if (isServerCall ())
196207 return false ;
197208 if (getClient () == null )
0 commit comments