Protect IN query from empty array