From: Niki Roo Date: Fri, 23 Mar 2018 22:21:24 +0000 (+0100) Subject: Visually improve comment without author (Gopher) X-Git-Url: https://git.nikiroo.be/?a=commitdiff_plain;h=86d03b2e4fe0a2b53b83e981388394f3c5965f27;p=gofetch.git Visually improve comment without author (Gopher) --- diff --git a/src/be/nikiroo/gofetch/output/Gopher.java b/src/be/nikiroo/gofetch/output/Gopher.java index 51da87f..f0c6f6d 100644 --- a/src/be/nikiroo/gofetch/output/Gopher.java +++ b/src/be/nikiroo/gofetch/output/Gopher.java @@ -68,10 +68,13 @@ public class Gopher extends Output { } appendLeft(builder, menu, comment.getTitle(), "** ", " ", space); - appendLeft(builder, menu, "(" + comment.getAuthor() + ")", " ", - " ", space); - builder.append((menu ? "i" : "") + "\r\n"); + if (comment.getAuthor() != null + && !comment.getAuthor().trim().isEmpty()) { + appendLeft(builder, menu, "(" + comment.getAuthor() + ")", " ", + " ", space); + builder.append((menu ? "i" : "") + "\r\n"); + } for (String line : comment.getContentLines()) { int depth = 0;