Helper extension method to help try get a non-null instance