diff options
Diffstat (limited to 'src/Theme.cpp')
-rw-r--r-- | src/Theme.cpp | 9 |
1 files changed, 8 insertions, 1 deletions
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(); } |