diff --git a/pelix/framework.py b/pelix/framework.py index 848e604c..430bb7b5 100644 --- a/pelix/framework.py +++ b/pelix/framework.py @@ -1362,9 +1362,10 @@ def get_service_references(self, clazz, ldap_filter=None): calling bundle and matching the filters. """ refs = self.__framework.find_service_references(clazz, ldap_filter) - for ref in refs: - if ref.get_bundle() is not self.__bundle: - refs.remove(ref) + if refs: + for ref in refs: + if ref.get_bundle() is not self.__bundle: + refs.remove(ref) return refs