diff options
author | Thomas White <taw@bitwiz.org.uk> | 2015-02-15 22:30:49 +0100 |
---|---|---|
committer | Thomas White <taw@bitwiz.org.uk> | 2015-02-15 22:30:49 +0100 |
commit | c12f041d4e151cf0bbbb4e2c92c4bbc45e5fa67a (patch) | |
tree | c675221d4d8e353f9ad865ef7994d0517012c7a3 /src | |
parent | 9ae1a42a0f0c63798c31272a71e326c9abb12b96 (diff) |
Avoid segfault if file can't be opened
Diffstat (limited to 'src')
-rw-r--r-- | src/colloquium.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/colloquium.c b/src/colloquium.c index 80909c1..61c0688 100644 --- a/src/colloquium.c +++ b/src/colloquium.c @@ -114,8 +114,11 @@ static void colloquium_open(GApplication *app, GFile **files, gint n_files, struct presentation *p; char *uri = g_file_get_path(files[i]); p = new_presentation(); - load_presentation(p, uri); - narrative_window_new(p, app); + if ( load_presentation(p, uri) == 0 ) { + narrative_window_new(p, app); + } else { + fprintf(stderr, "Failed to load '%s'\n", uri); + } g_free(uri); } } |