Fix possible crash attempting network connection

If we didn't get back a JSON encoded string (i.e., if the response
contained no '"') we would access a QList past its boundary.

I'm somewhat hopeful that this is a last second fix for an annoying bug
I've been trying to figure out for a while.

See #514

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Dirk Hohndel 2014-08-08 10:39:46 -07:00
parent 6fdbf2069d
commit 4a125384ac

View file

@ -47,7 +47,11 @@ void UpdateManager::requestReceived()
} else {
//No network error
QString response(reply->readAll());
QString responseBody = response.split("\"").at(1);
QString responseBody;
if (response.contains('"'))
responseBody = response.split("\"").at(1);
else
responseBody = response;
msgbox.setIcon(QMessageBox::Information);