From a09e1019317794b516585ea4ae7e88354241b444 Mon Sep 17 00:00:00 2001 From: tobi <31960611+tsmethurst@users.noreply.github.com> Date: Mon, 23 May 2022 17:10:48 +0200 Subject: [bugfix] If status URL is empty, use URI instead and don't log unnecessary error (#597) * test parse status with no URL * if no status URL is available, use the URI instead --- internal/typeutils/astointernal.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'internal/typeutils/astointernal.go') diff --git a/internal/typeutils/astointernal.go b/internal/typeutils/astointernal.go index 4c8a95dfd..e8b585f5f 100644 --- a/internal/typeutils/astointernal.go +++ b/internal/typeutils/astointernal.go @@ -184,10 +184,11 @@ func (c *converter) ASStatusToStatus(ctx context.Context, statusable ap.Statusab l := logrus.WithField("statusURI", status.URI) // web url for viewing this status - if statusURL, err := ap.ExtractURL(statusable); err != nil { - l.Infof("ASStatusToStatus: error extracting status URL: %s", err) - } else { + if statusURL, err := ap.ExtractURL(statusable); err == nil { status.URL = statusURL.String() + } else { + // if no URL was set, just take the URI + status.URL = status.URI } // the html-formatted content of this status -- cgit v1.2.3