Members of the KDE Community are recommended to subscribe to the kde-community mailing list at https://mail.kde.org/mailman/listinfo/kde-community to allow them to participate in important discussions and receive other important announcements

Commit 16e5845e authored by Linus Jahn's avatar Linus Jahn

Fix crash when receiving message without id

parent a233ac60
Pipeline #4911 passed with stages
in 24 minutes and 28 seconds
......@@ -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