From 735d508a29f2e67f1082ee922ee61ce9dec21c8a Mon Sep 17 00:00:00 2001 From: Konstantinos Sideris Date: Thu, 1 Mar 2018 09:31:08 +0200 Subject: Handle empty matrix ID (regression from 9de1ec1) fixes #259 --- src/MatrixClient.cc | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/MatrixClient.cc') diff --git a/src/MatrixClient.cc b/src/MatrixClient.cc index bcf7a62b..544f58cb 100644 --- a/src/MatrixClient.cc +++ b/src/MatrixClient.cc @@ -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()); -- cgit 1.5.1