diff options
author | Uwe Klotz <uklotz@mixxx.org> | 2020-04-12 12:06:02 +0200 |
---|---|---|
committer | Uwe Klotz <uklotz@mixxx.org> | 2020-04-12 12:06:31 +0200 |
commit | 9d0988e1c8db9387a229c05cad585242fae0bad5 (patch) | |
tree | da49185582c9dc5bf3a9bdb4895cda559cd7bc28 /src/network | |
parent | e33cfc6ee0890bd10023c7fa7516937b36a92ec6 (diff) |
Clarify error handling
Diffstat (limited to 'src/network')
-rw-r--r-- | src/network/jsonwebtask.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/network/jsonwebtask.cpp b/src/network/jsonwebtask.cpp index 4eed9887b0..e7e0ab81ba 100644 --- a/src/network/jsonwebtask.cpp +++ b/src/network/jsonwebtask.cpp @@ -78,6 +78,10 @@ bool readJsonContent( const auto jsonDoc = QJsonDocument::fromJson( jsonData, &parseError); + // QJsonDocument::fromJson() returns a non-null document + // if parsing succeeds and otherwise null on error. The + // parse error must only be evaluated if the returned + // document is null! if (jsonDoc.isNull()) { DEBUG_ASSERT(parseError.error != QJsonParseError::NoError); kLogger.warning() |