REGRESSION(180076): [Mac, iOS] Correct possible null dereference in printing code