Handle CSS errors

This commit is contained in:
Sebastian Ramacher 2018-05-27 23:37:23 +02:00
parent e6661bc648
commit 16e7dde9ed

View file

@ -305,7 +305,7 @@ init_ui(zathura_t* zathura)
return true; return true;
} }
static void static bool
init_css(zathura_t* zathura) init_css(zathura_t* zathura)
{ {
GiraraTemplate* csstemplate = GiraraTemplate* csstemplate =
@ -344,7 +344,11 @@ init_css(zathura_t* zathura)
girara_template_set_base(csstemplate, css); girara_template_set_base(csstemplate, css);
g_free(css); g_free(css);
g_bytes_unref(css_data); g_bytes_unref(css_data);
} else {
return false;
} }
return true;
} }
static void static void
@ -459,7 +463,9 @@ zathura_init(zathura_t* zathura)
init_jumplist(zathura); init_jumplist(zathura);
/* CSS for index mode */ /* CSS for index mode */
init_css(zathura); if (init_css(zathura) == false) {
goto error_free;
}
/* Shortcut helpers */ /* Shortcut helpers */
init_shortcut_helpers(zathura); init_shortcut_helpers(zathura);