From: Andreas Henriksson <andreas@fatal.se>
Subject: Avoid crash on unreadable journal

Avoid trying to dereference the first boot journal when our array of
boots doesn't contain any at all.
This should avoid crashing gnome-logs on startup when the user don't
have access to read the contents of /var/log/journal for example.

https://bugzilla.gnome.org/show_bug.cgi?id=770072

--- a/src/gl-window.c
+++ b/src/gl-window.c
@@ -435,6 +435,8 @@
     toolbar = GL_EVENT_TOOLBAR (priv->event_toolbar);
 
     boot_ids = gl_event_view_get_boot_ids (event);
+
+    if (boot_ids->len > 0) {
     boot_id = &g_array_index (boot_ids, GlJournalBootID, boot_ids->len - 1);
     boot_match = boot_id->boot_match;
 
@@ -447,6 +449,7 @@
                                                    "view-boot");
     variant = g_variant_new_string (boot_match);
     g_action_change_state (action_view_boot, variant);
+    }
 
     provider = gtk_css_provider_new ();
     g_signal_connect (provider, "parsing-error",
