From fc8081e6b052e2901aa56676c5cab61eaa5996e2 Mon Sep 17 00:00:00 2001 From: Thomas White Date: Wed, 17 Oct 2018 22:41:03 +0200 Subject: Apply most styles --- src/stylesheet.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/stylesheet.c') diff --git a/src/stylesheet.c b/src/stylesheet.c index 51cce6e..228c331 100644 --- a/src/stylesheet.c +++ b/src/stylesheet.c @@ -74,6 +74,11 @@ char *stylesheet_lookup(Stylesheet *ss, const char *path) node = json_path_query(path, ss->root, &err); array = json_node_get_array(node); + if ( json_array_get_length(array) < 1 ) { + json_node_unref(node); + return NULL; + } + v = json_array_get_string_element(array, 0); if ( v == NULL ) return NULL; -- cgit v1.2.3