summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAvinash Reddy <cassilasreddythemostwanted3108@gmail.com>2021-05-24 00:51:30 +0530
committerGitHub <noreply@github.com>2021-05-23 21:21:30 +0200
commitec6ae343dd30bd792f51007e35f9d08fefae48b9 (patch)
treee145f008c3d2994f9652d672dff3d35cfebc8115
parentb9fb3619594734017baaaca295c98c2881ce7423 (diff)
downloadmatterbridge-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
-rw-r--r--bridge/whatsapp/handlers.go4
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)