Handle edgecase when there are no buddies
This commit is contained in:
parent
97c8cfed94
commit
7302c4fc2c
|
@ -89,6 +89,7 @@ class WhatsAppBackend(SpectrumBackend):
|
||||||
"""Called when user logs in. Used to initialize roster."""
|
"""Called when user logs in. Used to initialize roster."""
|
||||||
self.logger.debug("handleBuddies(buddies=%s)", buddies)
|
self.logger.debug("handleBuddies(buddies=%s)", buddies)
|
||||||
buddies = [b for b in buddies.buddy]
|
buddies = [b for b in buddies.buddy]
|
||||||
|
if len(buddies) > 0:
|
||||||
user = buddies[0].userName
|
user = buddies[0].userName
|
||||||
self.sessions[user].loadBuddies(buddies)
|
self.sessions[user].loadBuddies(buddies)
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue