Show us exactly what you're doing, because so far your description is pretty vague:
That doesn't make much sense. Is it a property binding ? Is it a SQL binding ? Is it a script binding ?
There are several ways of handling lack of data, but to figure out the best/right one, we'll need to know what expects data, where it should come from, and what should happen if there is none.
I think he tried to use a python if statement in the query itself, which is why he got that error.