diff options
author | Avinash Reddy <cassilasreddythemostwanted3108@gmail.com> | 2021-05-24 00:51:30 +0530 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-05-23 21:21:30 +0200 |
commit | ec6ae343dd30bd792f51007e35f9d08fefae48b9 (patch) | |
tree | e145f008c3d2994f9652d672dff3d35cfebc8115 /bridge | |
parent | b9fb3619594734017baaaca295c98c2881ce7423 (diff) | |
download | matterbridge-msglm-ec6ae343dd30bd792f51007e35f9d08fefae48b9.tar.gz matterbridge-msglm-ec6ae343dd30bd792f51007e35f9d08fefae48b9.tar.bz2 matterbridge-msglm-ec6ae343dd30bd792f51007e35f9d08fefae48b9.zip |
Fix crash on encountering VideoMessage (whatsapp) (#1483)
* [whatsapp] fix crash on encountering VideoMessage
* Update handlers.go
* gofmt
Diffstat (limited to 'bridge')
-rw-r--r-- | bridge/whatsapp/handlers.go | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/bridge/whatsapp/handlers.go b/bridge/whatsapp/handlers.go index 8eb02b58..04e44693 100644 --- a/bridge/whatsapp/handlers.go +++ b/bridge/whatsapp/handlers.go @@ -237,6 +237,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) |