From 4a125384ac9e331130b20301a8f43687431189a1 Mon Sep 17 00:00:00 2001 From: Dirk Hohndel Date: Fri, 8 Aug 2014 10:39:46 -0700 Subject: 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 --- qt-ui/updatemanager.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'qt-ui') diff --git a/qt-ui/updatemanager.cpp b/qt-ui/updatemanager.cpp index 47554fcc5..4729998c7 100644 --- a/qt-ui/updatemanager.cpp +++ b/qt-ui/updatemanager.cpp @@ -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); -- cgit v1.2.3-70-g09d2