Handle empty matrix ID (regression from 9de1ec1)

fixes #259
This commit is contained in:
Konstantinos Sideris 2018-03-01 09:31:08 +02:00
parent f6c279f6f2
commit 735d508a29
3 changed files with 30 additions and 43 deletions

View file

@ -123,11 +123,6 @@ MatrixClient::login(const QString &username, const QString &password) noexcept
int status_code =
reply->attribute(QNetworkRequest::HttpStatusCodeAttribute).toInt();
if (reply->error()) {
emit loginError(reply->errorString());
return;
}
if (status_code == 403) {
emit loginError(tr("Wrong username or password"));
return;
@ -144,6 +139,11 @@ MatrixClient::login(const QString &username, const QString &password) noexcept
return;
}
if (reply->error()) {
emit loginError(reply->errorString());
return;
}
try {
mtx::responses::Login login =
nlohmann::json::parse(reply->readAll().data());