summaryrefslogtreecommitdiffstats
path: root/file.c
diff options
context:
space:
mode:
authorGravatar Dirk Hohndel <dirk@hohndel.org>2015-06-16 06:27:12 -0700
committerGravatar Dirk Hohndel <dirk@hohndel.org>2015-06-16 09:33:22 -0700
commita2c546152ebfd0e01dd7021433aa04b94150bf4a (patch)
tree414511af24b63543d3d1375c26a9d3e12efb1792 /file.c
parent854f55fd89f399ba59881b8b11a52d20e3847f72 (diff)
downloadsubsurface-a2c546152ebfd0e01dd7021433aa04b94150bf4a.tar.gz
Don't crash with NULL string in settings
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'file.c')
-rw-r--r--file.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/file.c b/file.c
index be8935a88..a9d5703cb 100644
--- a/file.c
+++ b/file.c
@@ -428,7 +428,9 @@ int parse_file(const char *filename)
int ret;
git = is_git_repository(filename, &branch, NULL);
- if (strstr(filename, prefs.cloud_git_url) && git == dummy_git_repository)
+ if (prefs.cloud_git_url &&
+ strstr(filename, prefs.cloud_git_url)
+ && git == dummy_git_repository)
/* opening the cloud storage repository failed for some reason
* give up here and don't send errors about git repositories */
return 0;