From 2fd5c0fa60d8a425d77ee10f09fe17a29795f55c Mon Sep 17 00:00:00 2001 From: itaiag Date: Mon, 7 Mar 2016 10:50:00 +0200 Subject: [PATCH] Fixed a condition when the execution description is not exist --- .../java/il/co/topq/report/resource/ReportResource.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/difido-server/src/main/java/il/co/topq/report/resource/ReportResource.java b/difido-server/src/main/java/il/co/topq/report/resource/ReportResource.java index 58a7b0e9..608265b3 100644 --- a/difido-server/src/main/java/il/co/topq/report/resource/ReportResource.java +++ b/difido-server/src/main/java/il/co/topq/report/resource/ReportResource.java @@ -13,6 +13,7 @@ import javax.ws.rs.Produces; import javax.ws.rs.core.MediaType; +import org.elasticsearch.common.lang3.StringUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.web.bind.annotation.RestController; @@ -66,7 +67,11 @@ public DataTable get(@PathParam("execution") int execution) { for (ExecutionMetaData meta : metaData) { final Map row = new HashMap(); row.put(ID, meta.getId()); - row.put(DESCRIPTION, meta.getDescription()); + if (!StringUtils.isEmpty(meta.getDescription())){ + row.put(DESCRIPTION, meta.getDescription()); + } else { + row.put(DESCRIPTION, meta.getFolderName()); + } row.put(LINK, meta.getUri()); row.put(DATE, meta.getDate()); row.put(TIME, meta.getTime());