Fix the error when get goal is null