check if $session->data['guest']['customer_group_id'] &  $session->data[...

...'customer']['customer_group_id'] isset

I have come across this issue that when using different modules, some may set the guest item in the session array, but not set the customer_group_id

what happens is this line of code in index.php troughs an error. best to avoid this by checking if set for both the guest array and the customer_group_id item.