Check out the following code:
private void Foo(object bar) { Type type = bar.GetType(); if (type != null) // Expression is always true { }
object.GetType is not virtual, so you cannot yourself implement a version that returns a null value. Therefore, if bar is null, you will get a NullReferenceException and otherwise, type will never by null.
object.GetType
bar
NullReferenceException
type