Functions that have a SelectMany in the LINQ query need a null check
NullReferenceError opened this issue · comments
NullReferenceError commented
Functions like "Get-GDriveComment", "Get-GAGroup" or "Get-GAGroupMember" should have some kind of null check to prevent the enumeration from returning a null reference exception when ToList is run on the result set. Create an empty group and call "Get-GAGroupMember" to recreate this issue.
IE, For Get-GAGroupMember:
WriteObject(members.List(GroupName, properties, StandardQueryParams: StandardQueryParams).Where(x => x.MembersValue != null).SelectMany(x => x.MembersValue).ToList());
This fix prevents the error from being thrown, but not sure if the empty result set should be something else: