From 8bd462f6dc4a714b1680cb11f525c05445d3da33 Mon Sep 17 00:00:00 2001 From: sebdet Date: Mon, 15 Jul 2019 17:13:43 +0200 Subject: 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 --- src/main/java/org/onap/clamp/loop/LoopController.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/main/java') diff --git a/src/main/java/org/onap/clamp/loop/LoopController.java b/src/main/java/org/onap/clamp/loop/LoopController.java index b862780de..7d41e489a 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; } } -- cgit 1.2.3-korg