backlight: fix potential null dereference in config parsing

parent 3cc76575
......@@ -52,7 +52,10 @@ namespace XimperShellNotificationCenter.Widgets {
Json.Object ?config = get_config (this);
if (config != null) {
min_brightness = int.max (0, get_prop<int> (config, "min"));
int ?min_val = get_prop<int> (config, "min");
if (min_val != null) {
min_brightness = int.max (0, min_val);
}
}
try {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment