data.sql_query compared against null is rather undefined