Fix maintenance mode detection #5755
authorChristian Kamm <mail@ckamm.de>
Tue, 6 Jun 2017 08:45:15 +0000 (10:45 +0200)
committerChristian Kamm <mail@ckamm.de>
Tue, 6 Jun 2017 08:45:41 +0000 (10:45 +0200)
The server sends "maintenance": "true" which isn't a json boolean...

src/libsync/connectionvalidator.cpp

index 5816655be77e756fe8838189c058b6bf705ba00c..0b5897f1ff688fb2a8981b90869ca6ede9565547 100644 (file)
@@ -139,7 +139,9 @@ void ConnectionValidator::slotStatusFound(const QUrl &url, const QJsonObject &in
         return;
     }
 
-    if (info["maintenance"].toBool()) {
+    // Check for maintenance mode: Servers send "true", so go through QVariant
+    // to parse it correctly.
+    if (info["maintenance"].toVariant().toBool()) {
         reportResult(MaintenanceMode);
         return;
     }