Compare string length instead of empty string

This commit is contained in:
Zed
2019-06-21 02:16:10 +02:00
parent abe21e3ebf
commit 89b6cfdf98
3 changed files with 6 additions and 6 deletions

View File

@@ -81,7 +81,7 @@ proc linkUser*(profile: Profile; h: string; username=true; class=""): string =
if username: "@" & profile.username
else: formatName(profile)
if h == "":
if h.len == 0:
return htmlgen.a(text, href = &"/{profile.username}", class=class)
let element = &"<{h} class=\"{class}\">{text}</{h}>"