aboutsummaryrefslogtreecommitdiff
path: root/src/stylesheet.c
diff options
context:
space:
mode:
authorThomas White <taw@bitwiz.me.uk>2018-10-17 22:41:03 +0200
committerThomas White <taw@bitwiz.me.uk>2018-10-17 22:41:03 +0200
commitfc8081e6b052e2901aa56676c5cab61eaa5996e2 (patch)
tree994ebd195611b462f8fd2b82a02827f855836932 /src/stylesheet.c
parentd7cf85134ea2559de04fbb094b1308b80e51f336 (diff)
Apply most styles
Diffstat (limited to 'src/stylesheet.c')
-rw-r--r--src/stylesheet.c5
1 files changed, 5 insertions, 0 deletions
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;