chore: fix panic

This commit is contained in:
xuu 2025-04-02 15:29:33 -06:00
parent 7d336285bf
commit 73eaac5bc6
Signed by: xuu
GPG Key ID: 8B3B0604F164E04F

View File

@ -180,6 +180,10 @@ func (r *HTWriter) WriteTo(w io.Writer) (int64, error) {
Host: "unknown.txt",
}
}
subject := ""
if s := twt.Subject(); s != nil {
subject = s.Tag().Text()
}
i, err = fmt.Fprintf(w, `
<article>
<header class="u-author h-card">
@ -214,8 +218,8 @@ func (r *HTWriter) WriteTo(w io.Writer) (int64, error) {
`, "/?uri="+twter.URI, twter.Avatar,
"/?uri="+twter.URI, twter.Nick,
twter.URI, uri.Host,
"/conv/"+twt.Subject().Tag().Text(), fmt.Sprintf("<time datetime='%s'>%s</time>", twt.Created().Format(time.RFC3339), twt.Created().Format(time.RFC822)),
"/conv/"+twt.Subject().Tag().Text(),
"/conv/"+subject, fmt.Sprintf("<time datetime='%s'>%s</time>", twt.Created().Format(time.RFC3339), twt.Created().Format(time.RFC822)),
"/conv/"+subject,
twt,
)
output += int64(i)