Fix crash when modelpath is blank and task is not cross_validate