mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
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:
parent
6fdbf2069d
commit
4a125384ac
1 changed files with 5 additions and 1 deletions
|
@ -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);
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue