Uri parsing .NET bug
Jan. 26th, 2017 09:14 amNormally, in case of invalid input Uri() code throws UriFormatException. But with really weird input Uri(baseUri, Url) overload can produce NullReferenceException:
[TestMethod] [ExpectedException(typeof(NullReferenceException))] public void UriFailureTest() { new Uri( new Uri("https://jobs.web.cern.ch/content/cern-jobs-insight/what-are-we-doing-while-you%E2%80%99re-waiting"), "https:/jobs.web.cern.ch/content/cern-jobs-insight/what-are-we-doing-while-you%E2%80%99re-waiting"); }