aboutsummaryrefslogtreecommitdiffstats
path: root/src/main
diff options
context:
space:
mode:
authorsebdet <sebastien.determe@intl.att.com>2019-07-15 17:13:43 +0200
committersebdet <sebastien.determe@intl.att.com>2019-07-15 17:27:50 +0200
commit8bd462f6dc4a714b1680cb11f525c05445d3da33 (patch)
tree14fe9cdd0ea8cce6ed96afa24692be6a987a675e /src/main
parentf248df69de034f43e04d8dbcf0ad836850cb9654 (diff)
Fix Nullpointer exception
Fix null pointer exception happening when getting a non existent SVG in db Issue-ID: CLAMP-424 Change-Id: I8941441b2af1ae2d54da977b467bde3abef52376 Signed-off-by: sebdet <sebastien.determe@intl.att.com>
Diffstat (limited to 'src/main')
-rw-r--r--src/main/java/org/onap/clamp/loop/LoopController.java5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/main/java/org/onap/clamp/loop/LoopController.java b/src/main/java/org/onap/clamp/loop/LoopController.java
index b862780d..7d41e489 100644
--- a/src/main/java/org/onap/clamp/loop/LoopController.java
+++ b/src/main/java/org/onap/clamp/loop/LoopController.java
@@ -116,12 +116,13 @@ public class LoopController {
/**
* Get the SVG representation of the loop
- *
+ *
* @param loopName
* The loop name
* @return The SVG representation
*/
public String getSVGRepresentation(String loopName) {
- return loopService.getLoop(loopName).getSvgRepresentation();
+ Loop loop = loopService.getLoop(loopName);
+ return loop != null ? loop.getSvgRepresentation() : null;
}
}