Deleting the plugin was not an option for my site, so thank you for the fix, @jturet (and r-a-y)! Works like a charm.
The ‘Fix’ zip file contains ALL the files from bp-group-hierarchy, btw. Just rename the extracted folder from ‘BP-Group-Hierarchy-ray-fixes’ to ‘bp-group-hierarchy’, and then replace the entire ‘bp-group-hierarchy’ directory (found in ‘plugins’) with this new directory and you’re good to go.
Props, @pareshradadiya !
Modifying the if block as Paresh suggests solves this problem.