From 489016f35880865b68099c44ae15c327441bfa0e Mon Sep 17 00:00:00 2001 From: tux3 Date: Sat, 19 Dec 2015 05:00:23 +0100 Subject: [PATCH] Fix #2439 --- src/persistence/history.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/persistence/history.cpp b/src/persistence/history.cpp index d314f7d95..906ceb8df 100644 --- a/src/persistence/history.cpp +++ b/src/persistence/history.cpp @@ -146,13 +146,14 @@ QList History::getChatHistory(const QString &friendPk, con auto rowCallback = [&messages](const QVector& row) { + // dispName and message could have null bytes, QString::fromUtf8 truncates on null bytes so we strip them messages += {row[0].toLongLong(), row[1].isNull(), QDateTime::fromMSecsSinceEpoch(row[2].toLongLong()), row[3].toString(), - row[4].toString(), + QString::fromUtf8(row[4].toByteArray().replace('\0',"")), row[5].toString(), - row[6].toString()}; + QString::fromUtf8(row[6].toByteArray().replace('\0',""))}; }; // Don't forget to update the rowCallback if you change the selected columns!