aboutsummaryrefslogtreecommitdiff
path: root/libstorycode
diff options
context:
space:
mode:
authorThomas White <taw@bitwiz.me.uk>2019-04-30 18:01:04 +0200
committerThomas White <taw@bitwiz.me.uk>2019-04-30 18:01:22 +0200
commit8ccc8b247769d7c1dfd21d674b7e87a9370363e2 (patch)
treeb53d11ffeb2a2b8c7881ee22edb91f878009498b /libstorycode
parent55c77ac30754985c4d02138476cf053d2dd863fd (diff)
Add an empty text item is the narrative is empty after loading
Diffstat (limited to 'libstorycode')
-rw-r--r--libstorycode/narrative.c5
1 files changed, 5 insertions, 0 deletions
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;
}