connector/tomatrix: handle nil better in mediaHashID

Signed-off-by: Sumner Evans <sumner.evans@automattic.com>
This commit is contained in:
Sumner Evans
2024-10-28 08:04:18 -06:00
parent 7cb70d9753
commit bcea875e66
+2
View File
@@ -39,6 +39,8 @@ func mediaHashID(ctx context.Context, m tg.MessageMediaClass) []byte {
return binary.BigEndian.AppendUint64(nil, uint64(media.Photo.GetID()))
case *tg.MessageMediaDocument:
return binary.BigEndian.AppendUint64(nil, uint64(media.Document.GetID()))
case nil:
return nil
default:
zerolog.Ctx(ctx).Error().Type("media_type", m).Msg("Attempted to get hash for unsupported media type ID")
}