From a54b258f2a63df5e21a988282bc3a11ea06cae32 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sven=20M=C3=A4der?= Date: Tue, 5 Apr 2022 11:10:04 +0200 Subject: [PATCH] Fixes #36: exception when user list is empty --- src/bridge/Greeter.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/bridge/Greeter.py b/src/bridge/Greeter.py index 3719a6d..c5e429c 100644 --- a/src/bridge/Greeter.py +++ b/src/bridge/Greeter.py @@ -116,8 +116,10 @@ class Greeter(BridgeObject): logger.debug("LightDM API connected") def _determine_shared_data_directory_path(self): - user = LightDMUsers.get_users()[0] - user_data_dir = LightDMGreeter.ensure_shared_data_dir_sync(user.get_name()) + users = LightDMUsers.get_users() + if not users: + return + user_data_dir = LightDMGreeter.ensure_shared_data_dir_sync(users[0].get_name()) if user_data_dir is None: return self._shared_data_directory = user_data_dir.rpartition('/')[0]