summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/poezio.py13
-rw-r--r--src/roster.py10
2 files changed, 19 insertions, 4 deletions
diff --git a/src/poezio.py b/src/poezio.py
index 1823b2ec..c013883c 100644
--- a/src/poezio.py
+++ b/src/poezio.py
@@ -33,9 +33,16 @@ def main():
cocore = singleton.Singleton(core.Core)
signal.signal(signal.SIGHUP, cocore.sighup_handler) # ignore ctrl-c
cocore.start()
- if not cocore.xmpp.start(): # Connect to remote server
- cocore.on_failed_connection()
- cocore.main_loop() # Refresh the screen, wait for user events etc
+ try:
+ if not cocore.xmpp.start(): # Connect to remote server
+ cocore.on_failed_connection()
+ except:
+ cocore.running = False
+ cocore.reset_curses()
+ print("Poezio could not start, maybe you tried aborting it while it was starting?\n"
+ "If you think it is abnormal, please run it with the -d option and report the bug.")
+ else:
+ cocore.main_loop() # Refresh the screen, wait for user events etc
if __name__ == '__main__':
main()
diff --git a/src/roster.py b/src/roster.py
index 3458d5b5..0c91b3fe 100644
--- a/src/roster.py
+++ b/src/roster.py
@@ -95,7 +95,15 @@ class Roster(object):
def get_groups(self, sort=''):
"""Return a list of the RosterGroups"""
- group_list = sorted(filter(lambda x: bool(x), self.groups.values()), key=lambda x: x.name.lower())
+ group_list = sorted(
+ filter(
+ lambda x: bool(x),
+ self.groups.values()
+ ),
+ key=lambda x: x.name.lower() if x.name else ''
+ )
+
+ log.debug("Current groups: %s", group_list)
for sorting in sort.split(':'):
if sorting == 'reverse':