diff --git a/tools/ratbagd.py b/tools/ratbagd.py index dcae8024..5ddec361 100644 --- a/tools/ratbagd.py +++ b/tools/ratbagd.py @@ -250,13 +250,13 @@ class Ratbagd(_RatbagdDBus): def __init__(self, api_version): super().__init__("Manager", None) - result = self._get_dbus_property("Devices") or [] - self._devices = [RatbagdDevice(objpath) for objpath in result] - self._proxy.connect("notify::g-name-owner", self._on_name_owner_changed) - if self.api_version == None and not self._proxy.get_cached_property_names(): + result = self._get_dbus_property("Devices") + if result is None and not self._proxy.get_cached_property_names(): raise RatbagdUnavailable("Make sure it is running and your user is in the required groups.") if self.api_version != api_version: raise RatbagdIncompatible(self.api_version or -1, api_version) + self._devices = [RatbagdDevice(objpath) for objpath in result or []] + self._proxy.connect("notify::g-name-owner", self._on_name_owner_changed) def _on_name_owner_changed(self, *kwargs): self.emit("daemon-disappeared")