Added quick null check to ModFlag