From 5d70c03d0a8c036f0ec2f382ac06b284f44beead Mon Sep 17 00:00:00 2001 From: Maciek Borzecki Date: Sat, 2 Jul 2016 22:59:57 +0200 Subject: [PATCH] devicemanager: handle cache load errors --- src/mconnect/devicemanager.vala | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/mconnect/devicemanager.vala b/src/mconnect/devicemanager.vala index e405a44..60be7f6 100644 --- a/src/mconnect/devicemanager.vala +++ b/src/mconnect/devicemanager.vala @@ -65,9 +65,11 @@ class DeviceManager : GLib.Object string[] groups = kf.get_groups(); foreach (string group in groups) { - var dev = new Device.from_cache(kf, group); - debug("device %s from cache", dev.to_string()); - found_device(dev); + var dev = Device.new_from_cache(kf, group); + if (dev != null) { + debug("device %s from cache", dev.to_string()); + found_device(dev); + } } } catch (Error e) { debug("error loading cache file: %s", e.message);