From 9611bd100e9e09dcb9f031550f2f0866841dc454 Mon Sep 17 00:00:00 2001 From: Fredrik Osterlind Date: Wed, 23 Feb 2011 15:39:25 +0100 Subject: [PATCH] bug fix: signal strenghts may not be registered --- tools/cooja/apps/mrm/java/se/sics/mrm/MRM.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tools/cooja/apps/mrm/java/se/sics/mrm/MRM.java b/tools/cooja/apps/mrm/java/se/sics/mrm/MRM.java index 383562221..ba9e45d0a 100644 --- a/tools/cooja/apps/mrm/java/se/sics/mrm/MRM.java +++ b/tools/cooja/apps/mrm/java/se/sics/mrm/MRM.java @@ -383,10 +383,16 @@ public class MRM extends AbstractRadioMedium { } public double getDestinationSignalStrength(Radio radio) { + if (signalStrengths.get(radio) == null) { + return Double.MIN_VALUE; + } return signalStrengths.get(radio); } public double getInterferenceSignalStrength(Radio radio) { + if (signalStrengths.get(radio) == null) { + return Double.MIN_VALUE; + } return signalStrengths.get(radio); } }