diff options
Diffstat (limited to 'internal/ap/extract.go')
-rw-r--r-- | internal/ap/extract.go | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/internal/ap/extract.go b/internal/ap/extract.go index 1ee0e008e..f8453c9c0 100644 --- a/internal/ap/extract.go +++ b/internal/ap/extract.go @@ -242,8 +242,9 @@ func ExtractImageURL(i WithImage) (*url.URL, error) { // ExtractSummary extracts the summary/content warning of an interface. func ExtractSummary(i WithSummary) (string, error) { summaryProp := i.GetActivityStreamsSummary() - if summaryProp == nil { - return "", errors.New("summary property was nil") + if summaryProp == nil || summaryProp.Len() == 0 { + // no summary to speak of + return "", nil } for iter := summaryProp.Begin(); iter != summaryProp.End(); iter = iter.Next() { @@ -544,12 +545,12 @@ func ExtractMentions(i WithTag) ([]*gtsmodel.Mention, error) { mentionable, ok := t.(Mentionable) if !ok { - continue + return nil, errors.New("mention was not convertable to ap.Mentionable") } mention, err := ExtractMention(mentionable) if err != nil { - continue + return nil, err } mentions = append(mentions, mention) |