From fe0ace52d36043e93cef91720f41f1ef38f4dd0d Mon Sep 17 00:00:00 2001
From: Daniel Carl <danielcarl@gmx.de>
Date: Fri, 21 Apr 2017 23:16:46 +0200
Subject: [PATCH] Don't warn about missing scripts file.

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 | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/setting.c b/src/setting.c
index 6e1fcde..f0752e8 100644
--- a/src/setting.c
+++ b/src/setting.c
@@ -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
-- 
2.20.1