From c12f041d4e151cf0bbbb4e2c92c4bbc45e5fa67a Mon Sep 17 00:00:00 2001 From: Thomas White Date: Sun, 15 Feb 2015 22:30:49 +0100 Subject: Avoid segfault if file can't be opened --- src/colloquium.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src/colloquium.c') 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); } } -- cgit v1.2.3