you could check if the variable has a value before...
# suitescript
j
you could check if the variable has a value before adding it to the filters array @karlenigma