Log an error and abort sending chat message without any content

This commit is contained in:
Sylvain Berfini 2018-01-23 13:57:56 +01:00
parent 69f1982653
commit 404e213cc4

View file

@ -593,8 +593,14 @@ void ChatMessagePrivate::send () {
// End of message modification
// ---------------------------------------
if (internalContent.isEmpty())
internalContent = *(contents.front());
if (internalContent.isEmpty()) {
if (contents.size() > 0) {
internalContent = *(contents.front());
} else {
lError() << "Trying to send a message without any content !";
return;
}
}
auto msgOp = dynamic_cast<SalMessageOpInterface *>(op);
if (internalContent.getContentType().isValid()) {