User permissions issue

-Errors encountered by users not having any aggregation permissions. Added a check for null values to fix this.