🐛 Fix panic
This commit is contained in:
parent
0126361b8d
commit
67a0219cf7
@ -667,7 +667,10 @@ func EditPost(item models.Post, og models.Post) (models.Post, error) {
|
|||||||
func updatePostAttachmentMeta(item models.Post, old ...models.Post) error {
|
func updatePostAttachmentMeta(item models.Post, old ...models.Post) error {
|
||||||
log.Debug().Any("attachments", item.Body["attachments"]).Msg("Updating post attachments meta...")
|
log.Debug().Any("attachments", item.Body["attachments"]).Msg("Updating post attachments meta...")
|
||||||
|
|
||||||
sameAsOld := reflect.DeepEqual(old[0].Body, item.Body)
|
sameAsOld := false
|
||||||
|
if len(old) > 0 {
|
||||||
|
sameAsOld = reflect.DeepEqual(old[0].Body, item.Body)
|
||||||
|
}
|
||||||
if len(old) > 0 && !sameAsOld {
|
if len(old) > 0 && !sameAsOld {
|
||||||
val, _ := old[0].Body["attachments"].([]string)
|
val, _ := old[0].Body["attachments"].([]string)
|
||||||
if dat, ok := item.Body["thumbnail"].(string); ok {
|
if dat, ok := item.Body["thumbnail"].(string); ok {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user