Your code snippet works for me. If you wish to use some other means of testing for an empty string you can always using the test utility. Man test(1) for more information.
Code:
set nmlfilelist
[ -z $nmlfilelist ] && echo "nmllist is empty"; exit (1)