Protect against error when parsing parameters with Bad Request

Related with #11795.