From 67048e9ea0a0dceb839cfaecdce7fab4e0f1127f Mon Sep 17 00:00:00 2001 From: fros4943 Date: Wed, 13 Dec 2006 11:55:06 +0000 Subject: [PATCH] bug fix: label may still be null when simulation updating --- tools/cooja/java/se/sics/cooja/plugins/SimControl.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tools/cooja/java/se/sics/cooja/plugins/SimControl.java b/tools/cooja/java/se/sics/cooja/plugins/SimControl.java index be670179e..92e0743d4 100644 --- a/tools/cooja/java/se/sics/cooja/plugins/SimControl.java +++ b/tools/cooja/java/se/sics/cooja/plugins/SimControl.java @@ -26,7 +26,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: SimControl.java,v 1.1 2006/08/21 12:13:08 fros4943 Exp $ + * $Id: SimControl.java,v 1.2 2006/12/13 11:55:06 fros4943 Exp $ */ package se.sics.cooja.plugins; @@ -86,6 +86,9 @@ public class SimControl extends VisPlugin { // Register as tickobserver simulation.addTickObserver(tickObserver = new Observer() { public void update(Observable obs, Object obj) { + if (simulation == null || simulationTime == null) + return; + // During simulation running, only update text 10 times each second if (lastTextUpdateTime < System.currentTimeMillis() - 100) { lastTextUpdateTime = System.currentTimeMillis();