I think this should be ```if dim_coord is not None and ...```