Due to exactly this issue, an increasing number of languages have an operator just for "if exists and not null": the null coalescing operator[0].
What "exists" means depends on the language; it can be as loose as checking if the variable has ever been set (PHP), but generally has nothing to do with truthiness/falsiness status.