View Single Post
  #2  
Old 02-11-2010, 11:10 AM
Derision
Developer
 
Join Date: Feb 2004
Location: UK
Posts: 1,540
Default

If either client is not in a group, that code will cause a crash because GetGroup() will return a NULL pointer.

This should work:
Code:
Group *g1 = c1->GetGroup();
Group *g2 = c2->GetGroup();

if(!g1 || !g2 || (g1 != g2)
{
        // One or both clients not in a group, or not in the same group
}
Reply With Quote