fix NPE if no groups

Change-Id: I25a00f51c2abe145ae176302bd4d3256722a0982