From 86d03b2e4fe0a2b53b83e981388394f3c5965f27 Mon Sep 17 00:00:00 2001 From: Niki Roo Date: Fri, 23 Mar 2018 23:21:24 +0100 Subject: [PATCH] Visually improve comment without author (Gopher) --- src/be/nikiroo/gofetch/output/Gopher.java | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) 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; -- 2.27.0