In the following code, when T is Rigidbody, calling componentToLookIn.GetComponent<T>() returns "null" when there is no rigidbody attached, instead of simply null:
public static class ComponentExtensions { public static bool TryFindComponent<T>(this Component componentToLookIn, out T componentToLookFor) { componentToLookFor = componentToLookIn.GetComponent<T>(); return componentToLookFor != null; } } Here is the debug window:
As a result, componentToLookFor != null ends up being true, which is obviously not what I want.
When I invoke componentToLookIn.GetComponent<T>() where T is NOT Rigidbody, null is returned as expected when there is no component of type T found.
What is so special about components of the Rigidbody type that GetComponent<Rigidbody>() behaves differently?
EDIT:
For contrast, here is the debug window when GetComponent<BoxCollider>() is invoked on a game object that does not have any component of the type BoxCollider: 
As you can see, the value of childComponent is simply null, not "null". componentToLookFor != null therefore returns false.

GetComponent<T>()on a game object that doesn't have thatTcomponent, Unity return that pseudo-null indicated by"null", as suggested by Tyyppi_77. Can you post the code that calls the extension method in the case of the rigidbody and the boxcollider? \$\endgroup\$