unique_answer: Check for empty vars before query

When an invalid value is fed to filter_var, the return value will be
nothing. Fix the code to check for empty variables before using them in
queries.
gitignore: Ignore vim .swp files
Merge pull request #97 from diegoe/unique_answer-fixes

Unique answer fixes