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();
|
||||
try {
|
||||
QList<QString> response;
|
||||
for (auto it = json["groups"].toArray().constBegin();
|
||||
it != json["groups"].toArray().constEnd();
|
||||
auto array = json["groups"].toArray();
|
||||
for (auto it = array.constBegin();
|
||||
it != array.constEnd();
|
||||
it++) {
|
||||
response.append(it->toString());
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user