As I have posted myself, and not too long ago either, using the "as" operator in C#, as in SomeType t = obj as SomeType; does not throw an InvalidCastException, but rather returns null if the type conversion did not work. In my Sorting example, the catch() should be changed to catch null pointer instead.