Fix the segfault
when iterating over the JSON array in getOwnCommunities
This commit is contained in:
parent
dc6aeccad3
commit
2f6df70a8b
@ -490,8 +490,9 @@ MatrixClient::getOwnCommunities() noexcept
|
|||||||
auto json = QJsonDocument::fromJson(data).object();
|
auto json = QJsonDocument::fromJson(data).object();
|
||||||
try {
|
try {
|
||||||
QList<QString> response;
|
QList<QString> response;
|
||||||
for (auto it = json["groups"].toArray().constBegin();
|
auto array = json["groups"].toArray();
|
||||||
it != json["groups"].toArray().constEnd();
|
for (auto it = array.constBegin();
|
||||||
|
it != array.constEnd();
|
||||||
it++) {
|
it++) {
|
||||||
response.append(it->toString());
|
response.append(it->toString());
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user