diff options
author | portix <portix@gmx.net> | 2011-11-15 11:43:38 +0100 |
---|---|---|
committer | portix <portix@gmx.net> | 2011-11-15 11:43:38 +0100 |
commit | 3a973d7c571cf8e71c8989d3166a2cdc078ecf33 (patch) | |
tree | ca7c95aef67b2ee1d1cf17298217622cd8f9f285 /src/session.c | |
parent | 7c1b32549f9175e32bd3e3da5c5dec90e2b101e0 (diff) | |
download | dwb-3a973d7c571cf8e71c8989d3166a2cdc078ecf33.zip |
Fix segfault in session_list if no sessions were saved
Diffstat (limited to 'src/session.c')
-rw-r--r-- | src/session.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/session.c b/src/session.c index 0b9414f3..e7390a6b 100644 --- a/src/session.c +++ b/src/session.c @@ -68,8 +68,12 @@ session_load_webview(GList *gl, char *uri, int last) { void session_list() { char *path = util_build_path(); - dwb.files.session = g_build_filename(path, "session", NULL); + dwb.files.session = util_check_directory(g_build_filename(path, dwb.misc.profile, "session", NULL)); char **content = session_get_groups(); + if (content == NULL) { + fprintf(stderr, "No sessions found for profile: %s\n", dwb.misc.profile); + exit(EXIT_SUCCESS); + } int i=1; while (content[i]) { char **group = g_strsplit(content[i], "\n", -1); |