@@ -93,25 +93,26 @@ public slots:
9393 }
9494
9595 // ==============================
96- // Page settings handling :
96+ // Page settings:
9797 // ==============================
9898
9999 void qGetPageSettings (QVariant settingsJsResult) {
100100 QJsonDocument settingsJsonDocument =
101101 QJsonDocument::fromJson (settingsJsResult.toString ().toUtf8 ());
102- QJsonObject settingsJsonObject = settingsJsonDocument.object ();
103102
104- // Get auto-start scripts:
105- QJsonArray autoStartScripts =
106- settingsJsonObject[" autoStartScripts" ].toArray ();
103+ if (!settingsJsonDocument.isEmpty ()) {
104+ QJsonObject settingsJsonObject = settingsJsonDocument.object ();
107105
108- foreach (const QJsonValue &value, autoStartScripts) {
109- QString autoStartScript = value.toString ();
110- qHandleScripts (autoStartScript);
111- }
106+ // Get auto-start scripts:
107+ QJsonArray autoStartScripts =
108+ settingsJsonObject[" autoStartScripts" ].toArray ();
109+
110+ foreach (const QJsonValue &value, autoStartScripts) {
111+ QString autoStartScript = value.toString ();
112+ qHandleScripts (autoStartScript);
113+ }
112114
113- // Get dialog and context menu labels:
114- if (settingsJsonObject.length () > 0 ) {
115+ // Get dialog and context menu labels:
115116 if (settingsJsonObject[" okLabel" ].toString ().length () > 0 ) {
116117 okLabel = settingsJsonObject[" okLabel" ].toString ();
117118 }
@@ -152,7 +153,7 @@ public slots:
152153 }
153154
154155 // ==============================
155- // Filesystem dialogs handling :
156+ // Filesystem dialogs:
156157 // ==============================
157158 void qHandleDialogs (QString dialogObjectName)
158159 {
@@ -163,11 +164,12 @@ public slots:
163164
164165 QJsonDocument dialogJsonDocument =
165166 QJsonDocument::fromJson (dialogSettings.toString ().toUtf8 ());
166- QJsonObject dialogJsonObject = dialogJsonDocument.object ();
167167
168- dialogJsonObject[" id" ] = dialogObjectName;
169-
170- qReadDialogSettings (dialogJsonObject);
168+ if (!dialogJsonDocument.isEmpty ()) {
169+ QJsonObject dialogJsonObject = dialogJsonDocument.object ();
170+ dialogJsonObject[" id" ] = dialogObjectName;
171+ qReadDialogSettings (dialogJsonObject);
172+ }
171173 }
172174 }
173175
@@ -225,7 +227,7 @@ public slots:
225227 }
226228
227229 // ==============================
228- // Scripts handling :
230+ // Perl scripts :
229231 // ==============================
230232 void qHandleScripts (QString scriptObjectName)
231233 {
@@ -434,7 +436,7 @@ public slots:
434436
435437protected:
436438 // ==============================
437- // Special URLs handling :
439+ // Special URLs:
438440 // ==============================
439441 bool acceptNavigationRequest (QWebFrame *frame,
440442 const QNetworkRequest &request,
0 commit comments