Bug fix: preventing NPE when party is null, it means it has no groups