Only the "me" and "you" pointers are automatically set to NULL when an entity is removed. Your "victim" pointer is not set to NULL. So, your "if (victim != NULL)" or "if(victim)" make no sense as they are always true.
You must not remove an entity as long as its pointer is still used in another function. Terminate that function first.