Sanity check missing in Description Stats Converter constructor 18/318/1
authorAlessandro Boch <aboch@cisco.com>
Wed, 8 May 2013 02:05:10 +0000 (19:05 -0700)
committerAlessandro Boch <aboch@cisco.com>
Wed, 8 May 2013 02:05:10 +0000 (19:05 -0700)
Signed-off-by: Alessandro Boch <aboch@cisco.com>
opendaylight/protocol_plugins/openflow/src/main/java/org/opendaylight/controller/protocol_plugin/openflow/internal/DescStatisticsConverter.java

index abad0b2ab5d5984cee70063697f9109b297602ac..e2945628868d0b4e1b6477e2f4285353f0d3f941 100644 (file)
@@ -19,9 +19,6 @@ import org.slf4j.LoggerFactory;
 /**
  * Utility class for converting openflow description statistics into SAL
  * NodeDescription object
- * 
- * 
- * 
  */
 public class DescStatisticsConverter {
     private static final Logger log = LoggerFactory
@@ -31,7 +28,8 @@ public class DescStatisticsConverter {
 
     public DescStatisticsConverter(List<OFStatistics> statsList) {
         this.hwDesc = null;
-        this.ofDesc = (OFDescriptionStatistics) statsList.get(0);
+        this.ofDesc = (statsList == null || statsList.isEmpty())? 
+                null : (OFDescriptionStatistics) statsList.get(0);
     }
 
     public NodeDescription getHwDescription() {