Avoid a notice in the direct database query sniff

Fixes #184
Merge pull request #185 from JDGrimes/issue-184

Avoid a notice in the direct database query sniff