From 8ccc8b247769d7c1dfd21d674b7e87a9370363e2 Mon Sep 17 00:00:00 2001 From: Thomas White Date: Tue, 30 Apr 2019 18:01:04 +0200 Subject: Add an empty text item is the narrative is empty after loading --- libstorycode/narrative.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'libstorycode/narrative.c') diff --git a/libstorycode/narrative.c b/libstorycode/narrative.c index c14ac6d..7e58f88 100644 --- a/libstorycode/narrative.c +++ b/libstorycode/narrative.c @@ -110,6 +110,11 @@ Narrative *narrative_load(GFile *file) g_bytes_unref(bytes); if ( n == NULL ) return NULL; + if ( n->n_items == 0 ) { + /* Presentation is empty. Add a dummy to start things off */ + narrative_add_text(n, strdup("")); + } + imagestore_set_parent(n->imagestore, g_file_get_parent(file)); return n; } -- cgit v1.2.3