From 68cd621053350651464c907901e246f49aa9c4dc Mon Sep 17 00:00:00 2001 From: erik Date: Wed, 6 Dec 2023 16:14:39 +0100 Subject: [PATCH] Test for empty string --- models/activitypub/actor.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/models/activitypub/actor.go b/models/activitypub/actor.go index db72e767f8..b11006b5ce 100644 --- a/models/activitypub/actor.go +++ b/models/activitypub/actor.go @@ -127,6 +127,10 @@ func removeEmptyStrings(ls []string) []string { } func ParseActorID(unvalidatedIRI, source string) (ActorID, error) { + if unvalidatedIRI == "" { + return ActorID{}, fmt.Errorf("the given IRI was empty") + } + u, err := url.Parse(unvalidatedIRI) // check if userID IRI is well formed url