Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/desktop.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOlivier Goffart <ogoffart@woboq.com>2019-10-25 15:14:47 +0300
committerCamila (Rebase PR Action) <hello@camila.codes>2020-11-24 21:22:33 +0300
commita7f010c3700b09cbc1d1a7ec9109ebb731c55723 (patch)
treecfcaf50ead352cd281ecf7347f8be2326db237d8 /src/gui/updater
parent1bf895cadcf7b3d1a683f8df34144533c3d1ee25 (diff)
Updater: Fix crash when there is an XML error
The problem was accessing the lines with an off by one error, while printing the log. Other problem included the fact that QDebug added spaces, quotes, and other things which made the error lot look right in the console. Issue #7545
Diffstat (limited to 'src/gui/updater')
-rw-r--r--src/gui/updater/updateinfo.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/gui/updater/updateinfo.cpp b/src/gui/updater/updateinfo.cpp
index 3b2d5b602..176df1ec2 100644
--- a/src/gui/updater/updateinfo.cpp
+++ b/src/gui/updater/updateinfo.cpp
@@ -88,9 +88,9 @@ UpdateInfo UpdateInfo::parseString(const QString &xml, bool *ok)
int errorLine = 0, errorCol = 0;
QDomDocument doc;
if (!doc.setContent(xml, false, &errorMsg, &errorLine, &errorCol)) {
- qCCritical(lcUpdater) << errorMsg << " at " << errorLine << "," << errorCol;
- qCCritical(lcUpdater()) << "->" << xml.splitRef("\n")[errorLine] << "<-\n"
- << QStringLiteral(" ").repeated(2 + errorCol - 1) << "^\n"
+ qCCritical(lcUpdater).noquote().nospace() << errorMsg << " at " << errorLine << "," << errorCol
+ << "\n" << xml.splitRef("\n").value(errorLine-1) << "\n"
+ << QString(" ").repeated(errorCol - 1) << "^\n"
<< "->" << xml << "<-";
if (ok)
*ok = false;