Don't warn about missing scripts file.
authorDaniel Carl <danielcarl@gmx.de>
Fri, 21 Apr 2017 21:16:46 +0000 (23:16 +0200)
committerDaniel Carl <danielcarl@gmx.de>
Fri, 21 Apr 2017 21:18:08 +0000 (23:18 +0200)
It's not required that the user has a scripts file. So don't attempt to
inject it if it is not present.

src/setting.c

index 6e1fcde..f0752e8 100644 (file)
@@ -593,7 +593,9 @@ static int user_scripts(Client *c, const char *name, DataType type, void *value,
     ucm = webkit_web_view_get_user_content_manager(c->webview);
 
     if (enabled) {
-        if (g_file_get_contents(vb.files[FILES_SCRIPT], &source, NULL, NULL)) {
+        if (vb.files[FILES_SCRIPT]
+                && g_file_get_contents(vb.files[FILES_SCRIPT], &source, NULL, NULL)) {
+
             script = webkit_user_script_new(
                 source, WEBKIT_USER_CONTENT_INJECT_ALL_FRAMES,
                 WEBKIT_USER_SCRIPT_INJECT_AT_DOCUMENT_END, NULL, NULL