Added null check on entity copy constructor