commit | 12eb26a515eb41fdec6003b88dd177986a406cd5 | [log] [tgz] |
---|---|---|
author | Jan Kundrát <jan.kundrat@cesnet.cz> | Fri Nov 08 10:47:10 2019 +0100 |
committer | Jan Kundrát <jan.kundrat@cesnet.cz> | Fri Nov 22 17:37:21 2019 +0100 |
tree | 0b0b7d87476955d90130069d3d516a83d3f36948 | |
parent | d5afb07ad4482d2405b572949f2ea864da8286ed [diff] |
Fix a possible NullPointerException Change-Id: Ifc7169b2757e81416785ec083f201e93a3c7580b
diff --git a/apps/optical-model/src/main/java/org/onosproject/net/optical/intent/impl/compiler/OpticalConnectivityIntentCompiler.java b/apps/optical-model/src/main/java/org/onosproject/net/optical/intent/impl/compiler/OpticalConnectivityIntentCompiler.java index 58c9d49..dcd97bf 100644 --- a/apps/optical-model/src/main/java/org/onosproject/net/optical/intent/impl/compiler/OpticalConnectivityIntentCompiler.java +++ b/apps/optical-model/src/main/java/org/onosproject/net/optical/intent/impl/compiler/OpticalConnectivityIntentCompiler.java
@@ -394,7 +394,8 @@ } Annotations annotations = edge.link().annotations(); - if (annotations != null && !annotations.value("metric").isEmpty()) { + if (annotations != null && + annotations.value("metric") != null && !annotations.value("metric").isEmpty()) { double metric = Double.parseDouble(annotations.value("metric")); return ScalarWeight.toWeight(metric); } else {