Skip to content

Commit

Permalink
Check if empty
Browse files Browse the repository at this point in the history
  • Loading branch information
Pjiesco committed Oct 7, 2023
1 parent a527952 commit 908fcfe
Showing 1 changed file with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,14 @@ public static Pair<JsonObject, TypeSpec.Builder> 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);
}
Expand Down

0 comments on commit 908fcfe

Please sign in to comment.