From 73eaac5bc6b3856e7e199248a35ba871e8d8bd38 Mon Sep 17 00:00:00 2001 From: xuu Date: Wed, 2 Apr 2025 15:29:33 -0600 Subject: [PATCH] chore: fix panic --- http-html.go | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/http-html.go b/http-html.go index 0eec660..3ef7ea4 100644 --- a/http-html.go +++ b/http-html.go @@ -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, `
@@ -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("", twt.Created().Format(time.RFC3339), twt.Created().Format(time.RFC822)), - "/conv/"+twt.Subject().Tag().Text(), + "/conv/"+subject, fmt.Sprintf("", twt.Created().Format(time.RFC3339), twt.Created().Format(time.RFC822)), + "/conv/"+subject, twt, ) output += int64(i)