From 1f74222bf4cfadead768b095c6b3f8d422ebf84c Mon Sep 17 00:00:00 2001 From: dec05eba Date: Fri, 11 Feb 2022 00:42:21 +0100 Subject: Add local-manga plugin to read local manga --- src/Theme.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'src/Theme.cpp') diff --git a/src/Theme.cpp b/src/Theme.cpp index 36c8ff7..8320054 100644 --- a/src/Theme.cpp +++ b/src/Theme.cpp @@ -34,6 +34,9 @@ namespace QuickMedia { static void parse_hex_set_color(const Json::Value &json_obj, const char *field_name, mgl::Color &color) { const Json::Value &json_val = json_obj[field_name]; + if(json_val.isNull()) + return; + if(!json_val.isString()) { fprintf(stderr, "Warning: theme variable \"%s\" does not exists or is not a string\n", field_name); return; @@ -69,10 +72,14 @@ namespace QuickMedia { static void get_bool_value(const Json::Value &json_obj, const char *field_name, bool &val) { const Json::Value &json_val = json_obj[field_name]; + if(json_val.isNull()) + return; + if(!json_val.isBool()) { - fprintf(stderr, "Warning: theme variable \"%s\" does not exists or is not a boolean\n", field_name); + fprintf(stderr, "Warning: theme variable \"%s\" is not a boolean\n", field_name); return; } + val = json_val.asBool(); } -- cgit v1.2.3