diff options
Diffstat (limited to 'protocols/WhatsApp/src/WhatsAPI++/WAConnection.cpp')
-rw-r--r-- | protocols/WhatsApp/src/WhatsAPI++/WAConnection.cpp | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/protocols/WhatsApp/src/WhatsAPI++/WAConnection.cpp b/protocols/WhatsApp/src/WhatsAPI++/WAConnection.cpp index 524bb80f2a..e6640b0156 100644 --- a/protocols/WhatsApp/src/WhatsAPI++/WAConnection.cpp +++ b/protocols/WhatsApp/src/WhatsAPI++/WAConnection.cpp @@ -875,7 +875,15 @@ void WAConnection::processUploadResponse(ProtocolTreeNode * node, FMessage * mes fileName = tempfileName.substr(index);
}
else {
- string json = MediaUploader::pushfile(node->getChild("media")->getAttributeValue("url"),message, this->user);
+ ProtocolTreeNode *media = node->getChild("media");
+ if (media == NULL)
+ return;
+
+ string url = media->getAttributeValue("url");
+ if(url.empty())
+ return;
+
+ string json = MediaUploader::pushfile(url,message, this->user);
if (json.empty())
return;
|