From 3893969096e51224572d87306f96d5147b7eaa18 Mon Sep 17 00:00:00 2001 From: fros4943 Date: Thu, 4 Dec 2008 13:04:26 +0000 Subject: [PATCH] check that simulation is running before joining sim thread --- tools/cooja/java/se/sics/cooja/Simulation.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tools/cooja/java/se/sics/cooja/Simulation.java b/tools/cooja/java/se/sics/cooja/Simulation.java index 949a5e4fd..fae8cb581 100644 --- a/tools/cooja/java/se/sics/cooja/Simulation.java +++ b/tools/cooja/java/se/sics/cooja/Simulation.java @@ -24,7 +24,7 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * - * $Id: Simulation.java,v 1.32 2008/12/04 12:44:02 fros4943 Exp $ + * $Id: Simulation.java,v 1.33 2008/12/04 13:04:26 fros4943 Exp $ */ package se.sics.cooja; @@ -275,7 +275,9 @@ public class Simulation extends Observable implements Runnable { /* Wait until simulation stops */ if (Thread.currentThread() != thread) { try { - thread.join(); + if (thread != null) { + thread.join(); + } } catch (InterruptedException e) { } }