From 908fcfee3f6de8096e5619072b53a95d35057589 Mon Sep 17 00:00:00 2001 From: Pjiesco Date: Sat, 7 Oct 2023 11:31:23 +0200 Subject: [PATCH] Check if empty --- .../annotations/processor/SettingProcessor.java | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/AnnotationsProcessor/src/main/java/com/christophecvb/touchportal/annotations/processor/SettingProcessor.java b/AnnotationsProcessor/src/main/java/com/christophecvb/touchportal/annotations/processor/SettingProcessor.java index a58e28d..6e27f22 100644 --- a/AnnotationsProcessor/src/main/java/com/christophecvb/touchportal/annotations/processor/SettingProcessor.java +++ b/AnnotationsProcessor/src/main/java/com/christophecvb/touchportal/annotations/processor/SettingProcessor.java @@ -38,9 +38,14 @@ public static Pair process(TouchPortalPluginAnnota if (!setting.tooltip().body().isEmpty()) { JsonObject tooltip = new JsonObject(); - tooltip.addProperty(SettingHelper.Tooltip.TITLE, setting.tooltip().title()); tooltip.addProperty(SettingHelper.Tooltip.BODY, setting.tooltip().body()); - tooltip.addProperty(SettingHelper.Tooltip.DOC_URL, setting.tooltip().docUrl()); + + if (!setting.tooltip().title().isEmpty()) { + tooltip.addProperty(SettingHelper.Tooltip.TITLE, setting.tooltip().title()); + } + if (!setting.tooltip().docUrl().isEmpty()) { + tooltip.addProperty(SettingHelper.Tooltip.DOC_URL, setting.tooltip().docUrl()); + } jsonSetting.add(SettingHelper.TOOLTIP, tooltip); }