From c481c3f270fee047539a610bf3febc1cdbcb7927 Mon Sep 17 00:00:00 2001 From: Marco Pesenti Gritti Date: Fri, 12 May 2006 18:46:33 -0400 Subject: [PATCH] Return None if the service is unknown --- sugar/p2p/Group.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/sugar/p2p/Group.py b/sugar/p2p/Group.py index fda5f2f7..6ba5c35d 100644 --- a/sugar/p2p/Group.py +++ b/sugar/p2p/Group.py @@ -73,7 +73,10 @@ class LocalGroup(Group): self._owner.register() def get_service(self, name, stype): - return self._services[(name, stype)] + if self._services.has_key((name, stype)): + return self._services[(name, stype)] + else + return None def get_buddy(self, name): return self._buddies[name]