mirror of
https://github.com/superseriousbusiness/gotosocial.git
synced 2025-12-22 22:36:14 -06:00
Handle nil statuses in processContentType
This commit is contained in:
parent
5ecbda32af
commit
ac709a1205
1 changed files with 6 additions and 4 deletions
|
|
@ -359,12 +359,14 @@ func processContentType(
|
||||||
case form.ContentType != "":
|
case form.ContentType != "":
|
||||||
return typeutils.APIContentTypeToContentType(form.ContentType)
|
return typeutils.APIContentTypeToContentType(form.ContentType)
|
||||||
|
|
||||||
// No content type on the form, return the status's current content type.
|
// No content type on the form, return the existing
|
||||||
case status.ContentType != 0:
|
// status's current content type if there is one.
|
||||||
|
case status != nil && status.ContentType != 0:
|
||||||
return status.ContentType
|
return status.ContentType
|
||||||
|
|
||||||
// Old statuses may not have a saved content type;
|
// We aren't editing an existing status, or if we are
|
||||||
// return the user's default content type preference.
|
// it's an old one that doesn't have a saved content
|
||||||
|
// type. Use the user's default content type setting.
|
||||||
case accountDefaultContentType != "":
|
case accountDefaultContentType != "":
|
||||||
return typeutils.APIContentTypeToContentType(apimodel.StatusContentType(accountDefaultContentType))
|
return typeutils.APIContentTypeToContentType(apimodel.StatusContentType(accountDefaultContentType))
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue