dennisgorelik: 2020-06-13 in my home office (Default)
[personal profile] dennisgorelik
Normally, 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");
}

Date: 2017-01-26 05:52 pm (UTC)
juan_gandhi: (Default)
From: [personal profile] juan_gandhi
Забавно.

Profile

dennisgorelik: 2020-06-13 in my home office (Default)
Dennis Gorelik

May 2026

S M T W T F S
     12
345 6789
10111213141516
17181920212223
24252627282930
31      

Most Popular Tags

Page Summary

Style Credit

Expand Cut Tags

No cut tags
Page generated May. 20th, 2026 11:09 am
Powered by Dreamwidth Studios