[mono-android] Not catching null reference - why?

Jonathan Pryor jonp at xamarin.com
Wed Jun 27 13:47:21 UTC 2012


On Jun 26, 2012, at 9:03 PM, Joel Low wrote:
> Isn’t the normal (= .NET) behaviour to throw an InvalidCastException in this case?

No. The `value as Type` expression will either return null or return a non-null instance of Type. Type cannot be a value type.

	http://msdn.microsoft.com/en-us/library/cscsdfbt.aspx

 - Jon



More information about the Monodroid mailing list