From 44201a4f4e5ee499ed7dfaa41d66383cbc655ab6 Mon Sep 17 00:00:00 2001 From: fros4943 Date: Wed, 23 Aug 2006 12:18:27 +0000 Subject: [PATCH] load simulation bug fix: loading a simulation and removing interfaces caused null-pointer exception --- .../cooja/java/se/sics/cooja/contikimote/ContikiMote.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/tools/cooja/java/se/sics/cooja/contikimote/ContikiMote.java b/tools/cooja/java/se/sics/cooja/contikimote/ContikiMote.java index 0c2edb5ae..afaeef531 100644 --- a/tools/cooja/java/se/sics/cooja/contikimote/ContikiMote.java +++ b/tools/cooja/java/se/sics/cooja/contikimote/ContikiMote.java @@ -26,7 +26,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: ContikiMote.java,v 1.1 2006/08/21 12:13:10 fros4943 Exp $ + * $Id: ContikiMote.java,v 1.2 2006/08/23 12:18:27 fros4943 Exp $ */ package se.sics.cooja.contikimote; @@ -300,7 +300,10 @@ public class ContikiMote implements Mote { } MoteInterface moteInterface = myInterfaceHandler.getInterfaceOfType(moteInterfaceClass); - moteInterface.setConfigXML(element.getChildren()); + if (moteInterface != null) + moteInterface.setConfigXML(element.getChildren()); + else + logger.warn("Can't restore configuration for non-existing interface: " + moteInterfaceClass.getName()); } }