aboutsummaryrefslogtreecommitdiff
path: root/src/stylesheet.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/stylesheet.c')
-rw-r--r--src/stylesheet.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/stylesheet.c b/src/stylesheet.c
index b5dce52..96172a4 100644
--- a/src/stylesheet.c
+++ b/src/stylesheet.c
@@ -155,6 +155,11 @@ char *stylesheet_lookup(Stylesheet *ss, const char *path, const char *key)
char *ret = NULL;
JsonNode *node = NULL;
+ if ( ss == NULL ) {
+ fprintf(stderr, _("No stylesheet!\n"));
+ return NULL;
+ }
+
obj = find_stylesheet_object(ss, path, &node);
if ( json_object_has_member(obj, key) ) {
@@ -181,6 +186,11 @@ int stylesheet_set(Stylesheet *ss, const char *path, const char *key,
JsonNode *node = NULL;
int r = 1;
+ if ( ss == NULL ) {
+ fprintf(stderr, _("No stylesheet!\n"));
+ return 1;
+ }
+
obj = find_stylesheet_object(ss, path, &node);
if ( obj != NULL ) {
json_object_set_string_member(obj, key, new_val);
@@ -199,6 +209,11 @@ int stylesheet_delete(Stylesheet *ss, const char *path, const char *key)
JsonNode *node = NULL;
int r = 1;
+ if ( ss == NULL ) {
+ fprintf(stderr, _("No stylesheet!\n"));
+ return 1;
+ }
+
obj = find_stylesheet_object(ss, path, &node);
if ( obj != NULL ) {
json_object_remove_member(obj, key);