Fix default_query_method

Error occurred when value is null that causes toString() throws error. 
Added a check to make sure value is not null before returning.