[whatsapp] fix crash on encountering VideoMessage

This commit is contained in:
Avinash Reddy
2021-05-22 06:18:46 +00:00
committed by GitHub
parent a189298ab0
commit 93901eb657

View File

@@ -232,6 +232,10 @@ func (b *Bwhatsapp) HandleVideoMessage(message whatsapp.VideoMessage) {
return
}
if len(fileExt) == 0 {
fileExt = append(fileExt, ".mp4")
}
filename := fmt.Sprintf("%v%v", message.Info.Id, fileExt[0])
b.Log.Debugf("Trying to download %s with size %#v and type %s", filename, message.Length, message.Type)