Result from Query database by script

i built some query database by script, then i use the selected result to calculate something.
when there are some selected result, it is ok; but there is null(no data selected) result selected, ignition will show the error information. then how would i adjust the query result is null or not , is there some easy way?

Thanks in advanced!