diff options
author | Konstantinos Sideris <sideris.konstantin@gmail.com> | 2018-01-21 18:25:58 +0200 |
---|---|---|
committer | Konstantinos Sideris <sideris.konstantin@gmail.com> | 2018-01-21 18:25:58 +0200 |
commit | fc890f572c602b098aceb1fad21ad8bfe84c8131 (patch) | |
tree | bd9e91e3381accd3de92d1f1e6065fcdf1bb09d2 | |
parent | Use the Accept-Content header to enable response compression (diff) | |
download | nheko-fc890f572c602b098aceb1fad21ad8bfe84c8131.tar.xz |
Fix iterator crash
-rw-r--r-- | src/MatrixClient.cc | 9 |
1 files 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<QString> 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(); |