don't include null values in the query string

At the moment, it dies with a null reference exception.