Fixing a null pointer exception which may occur if no service references
are returned