diff options
author | dec05eba <dec05eba@protonmail.com> | 2022-02-11 00:42:21 +0100 |
---|---|---|
committer | dec05eba <dec05eba@protonmail.com> | 2022-02-11 00:42:21 +0100 |
commit | 1f74222bf4cfadead768b095c6b3f8d422ebf84c (patch) | |
tree | 39035288edb79852cef6237f0d7ab8ea146cf218 /src/Theme.cpp | |
parent | 404ac476a213164a041f0f53be30855df815aa6a (diff) |
Add local-manga plugin to read local manga
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(); } |