From 5ae473dcd1f452713203c13bcbcd556c802af516 Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Thu, 16 Aug 2018 13:37:07 +1000 Subject: [PATCH] tools: make ratbagd a bit more robust regarding None object path lists Not sure why this is happening exactly, but it's better to handle this case without an immdiate exception. Fixes https://github.com/libratbag/piper/issues/228 Signed-off-by: Peter Hutterer --- tools/ratbagd.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tools/ratbagd.py b/tools/ratbagd.py index 717a3fe1..611e3aeb 100644 --- a/tools/ratbagd.py +++ b/tools/ratbagd.py @@ -411,15 +411,15 @@ class RatbagdProfile(_RatbagdDBus): # FIXME: if we start adding and removing objects from any of these # lists, things will break! - result = self._get_dbus_property("Resolutions") + result = self._get_dbus_property("Resolutions") or [] self._resolutions = [RatbagdResolution(objpath) for objpath in result] self._subscribe_dirty(self._resolutions) - result = self._get_dbus_property("Buttons") + result = self._get_dbus_property("Buttons") or [] self._buttons = [RatbagdButton(objpath) for objpath in result] self._subscribe_dirty(self._buttons) - result = self._get_dbus_property("Leds") + result = self._get_dbus_property("Leds") or [] self._leds = [RatbagdLed(objpath) for objpath in result] self._subscribe_dirty(self._leds)