only stop controllers that have been created
diff --git a/asterix-app/src/main/java/edu/uci/ics/asterix/api/common/AsterixHyracksIntegrationUtil.java b/asterix-app/src/main/java/edu/uci/ics/asterix/api/common/AsterixHyracksIntegrationUtil.java
index 8b64b18..8e2a695 100644
--- a/asterix-app/src/main/java/edu/uci/ics/asterix/api/common/AsterixHyracksIntegrationUtil.java
+++ b/asterix-app/src/main/java/edu/uci/ics/asterix/api/common/AsterixHyracksIntegrationUtil.java
@@ -96,9 +96,9 @@
     }
 
     public static void deinit() throws Exception {
-        nc2.stop();
-        nc1.stop();
-        cc.stop();
+        if (nc2 != null) nc2.stop();
+        if (nc1 != null) nc1.stop();
+        if (cc != null) cc.stop();
     }
 
     public static void runJob(JobSpecification spec) throws Exception {