Remove one pointer too many

This commit is contained in:
Melody Becker 2025-04-07 15:02:23 +02:00
parent e534fc8ec4
commit 6f9ac80c39

View file

@ -139,7 +139,7 @@ func UnmarshalPreprocessed(
// Find an attribute in an ActivityPub object of the given type
// Returns a pointer to the found attribute and whether it found it
// 2nd parameter is true if the attribute was found, false otherwise
func FindAttribute[T BaseApChain](object BaseApChain) (*T, bool) {
func FindAttribute[T BaseApChain](object BaseApChain) (T, bool) {
var obj T
var ok bool
// Try and cast object into wanted type
@ -150,8 +150,8 @@ func FindAttribute[T BaseApChain](object BaseApChain) (*T, bool) {
object, ok = object.GetSelfOrBase()
// If this is the final object in the chain, cancel and return false
if !ok {
return nil, false
return obj, false
}
}
return &obj, true
return obj, true
}