the nullptr test is a few lines above. at this time, mesh cannot be a nullptr.