Added null check for bad meshes