From 92319d61cdf50ad14ab27c78e8a8f123764fdf15 Mon Sep 17 00:00:00 2001 From: Robert von Burg Date: Tue, 10 Sep 2019 17:11:15 +0200 Subject: [PATCH] [Fix] Always set a message on ServiceResult.toJson() --- .../src/main/java/li/strolch/service/api/ServiceResult.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/li.strolch.agent/src/main/java/li/strolch/service/api/ServiceResult.java b/li.strolch.agent/src/main/java/li/strolch/service/api/ServiceResult.java index 8313e38ab..86d1552f5 100644 --- a/li.strolch.agent/src/main/java/li/strolch/service/api/ServiceResult.java +++ b/li.strolch.agent/src/main/java/li/strolch/service/api/ServiceResult.java @@ -16,6 +16,7 @@ package li.strolch.service.api; import static li.strolch.utils.helper.ExceptionHelper.formatException; +import static li.strolch.utils.helper.StringHelper.isEmpty; import java.util.ResourceBundle; @@ -188,7 +189,7 @@ public class ServiceResult { JsonObject json = new JsonObject(); json.addProperty("state", this.state.name()); - json.addProperty("msg", this.message); + json.addProperty("msg", isEmpty(this.message) ? "-" : this.message); if (this.throwable != null) { json.addProperty("exceptionMsg", ExceptionHelper.getExceptionMessageWithCauses(this.throwable));