In my controller code I am using: Request.Url.<Something>
. ReSharper suggests that Request.Url
can be null.
So, when exactly can Request.Url
be null? I am not talking about testing, I am interested only about an Application that is live / has already been deployed.
Please note that I have not received any NullReferenceException
s from using Request.Url
up to this point.
HttpRequestBase
is a class and ReSharper sees it as an actual Class, nothing more (theoretically, it can be null
). So it does not analyze the usage of this specific Class.
In reality, I think that Request.Url
will never be null
, so just ignore ReSharper in this case.