Fix for null ref error when query string has a trailing ampersand

When the query string has an trailing ampersand, the Endpointmatching rule was throwing a  Null ref error.