From fc890f572c602b098aceb1fad21ad8bfe84c8131 Mon Sep 17 00:00:00 2001 From: Konstantinos Sideris Date: Sun, 21 Jan 2018 18:25:58 +0200 Subject: [PATCH] Fix iterator crash --- src/MatrixClient.cc | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/MatrixClient.cc b/src/MatrixClient.cc index 44257172..fdc675b4 100644 --- a/src/MatrixClient.cc +++ b/src/MatrixClient.cc @@ -516,11 +516,10 @@ MatrixClient::getOwnCommunities() noexcept try { QList response; - for (auto it = json["groups"].toArray().constBegin(); - it != json["groups"].toArray().constEnd(); - it++) { - response.append(it->toString()); - } + + for (auto group : json["groups"].toArray()) + response.append(group.toString()); + emit getOwnCommunitiesResponse(response); } catch (DeserializationException &e) { qWarning() << "Own communities:" << e.what();