[Mono-list] Hashtable behaviour

Glen Ford glen.ford at spinvox.com
Tue Sep 5 10:48:47 EDT 2006


Has else anyone noticed the following on mono 1.1.16.1 ...

Hashtable table = new Hashtable();
int myvalue = (int)table[32];

Generates an exception:

Unhandled Exception: System.NullReferenceException: Object reference not 
set to an instance of an object


However the following doesn't ...

Hashtable table = new Hashtable();
string myvalue = (string)table["blah"];


I would have expected a NullReferenceException in the second case as well.


Regards,



Glen
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.ximian.com/pipermail/mono-list/attachments/20060905/a71375cd/attachment.html 


More information about the Mono-list mailing list