Commit 16e5845e authored by LNJ's avatar LNJ 🖖

Fix crash when receiving message without id

parent a233ac60
......@@ -173,6 +173,7 @@ void Database::convertDatabase()
// TODO: the next time we change the messages table, we need to do:
// * rename author to sender, edited to isEdited
// * delete author_resource, recipient_resource
// * remove 'NOT NULL' from id
}
QSqlRecord updateRecord;
......
......@@ -183,7 +183,7 @@ void MessageDb::addMessage(const Message &msg)
record.setValue("recipient", msg.to());
record.setValue("timestamp", msg.stamp().toString(Qt::ISODate));
record.setValue("message", msg.body());
record.setValue("id", msg.id());
record.setValue("id", msg.id().isEmpty() ? " " : msg.id());
record.setValue("isSent", msg.isSent());
record.setValue("isDelivered", msg.isDelivered());
record.setValue("type", int(msg.type()));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment