Verify the type of query results before accessing them.