Sonar suggestions to avoid possible NPE

Change-Id: Ifc188d5f8ad2a068dfd5c3f446ce926f3d43b4dc
diff --git a/apps/t3/web/src/main/java/org/onosproject/t3/rest/T3WebResource.java b/apps/t3/web/src/main/java/org/onosproject/t3/rest/T3WebResource.java
index 0950c2d..275be8c 100644
--- a/apps/t3/web/src/main/java/org/onosproject/t3/rest/T3WebResource.java
+++ b/apps/t3/web/src/main/java/org/onosproject/t3/rest/T3WebResource.java
@@ -205,10 +205,9 @@
                     previousTrace = trace;
                 }
                 nodeOutput.set("trace", traceNode(previousTrace, trace));
-                if (previousTrace == null || !previousTrace.equals(trace)) {
-                    previousTrace = trace;
+                if (trace != null) {
+                    nodeOutput.put("failure", trace.resultMessage());
                 }
-                nodeOutput.put("failure", trace.resultMessage());
             }
             nodeOutput.put("total traces", totalTraces);
             nodeOutput.put("errors", failedTraces.size());