Is a null return an actual error from this code? you could also do something like
 Code:
if $returnvalue=''
;report error
endif