mirror of
https://github.com/superseriousbusiness/gotosocial.git
synced 2025-10-28 21:12:25 -05:00
[chore] Harden up boolptr logic on Accounts, warn if not set (#2544)
This commit is contained in:
parent
7ec1e1332e
commit
5ca86b1c57
6 changed files with 208 additions and 38 deletions
|
|
@ -492,18 +492,6 @@ func ExtractFields(i WithAttachment) []*gtsmodel.Field {
|
|||
return fields
|
||||
}
|
||||
|
||||
// ExtractDiscoverable extracts the Discoverable boolean
|
||||
// of the given WithDiscoverable interface. Will return
|
||||
// an error if Discoverable was nil.
|
||||
func ExtractDiscoverable(i WithDiscoverable) (bool, error) {
|
||||
discoverableProp := i.GetTootDiscoverable()
|
||||
if discoverableProp == nil {
|
||||
return false, gtserror.New("discoverable was nil")
|
||||
}
|
||||
|
||||
return discoverableProp.Get(), nil
|
||||
}
|
||||
|
||||
// ExtractURL extracts the first URI it can find from the
|
||||
// given WithURL interface, or an error if no URL was set.
|
||||
// The ID of a type will not work, this function wants a URI
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue