Prevent NullPointerException
Change-Id: Id27490dfcae211bb7889090c6a53a400c3a06dbe
diff --git a/core/net/src/main/java/org/onosproject/net/intent/impl/compiler/OpticalCircuitIntentCompiler.java b/core/net/src/main/java/org/onosproject/net/intent/impl/compiler/OpticalCircuitIntentCompiler.java
index f8bfb19..15ff1df 100644
--- a/core/net/src/main/java/org/onosproject/net/intent/impl/compiler/OpticalCircuitIntentCompiler.java
+++ b/core/net/src/main/java/org/onosproject/net/intent/impl/compiler/OpticalCircuitIntentCompiler.java
@@ -15,6 +15,7 @@
*/
package org.onosproject.net.intent.impl.compiler;
+import com.google.common.base.Strings;
import org.apache.commons.lang3.tuple.Pair;
import org.apache.felix.scr.annotations.Activate;
import org.apache.felix.scr.annotations.Component;
@@ -133,8 +134,8 @@
//TODO for reduction check if the new capacity is smaller than the size of the current mapping
String propertyString = Tools.get(properties, "maxCapacity");
- //Ignore if propertyString is empty
- if (!propertyString.isEmpty()) {
+ //Ignore if propertyString is empty or null
+ if (!Strings.isNullOrEmpty(propertyString)) {
try {
int temp = Integer.parseInt(propertyString);
//Ensure value is non-negative but allow zero as a way to shutdown the link