[Mono-list] FieldInfo.GetValue trouble with null

Philip phil@noggle.biz
Sun, 04 Apr 2004 14:42:03 -0400


Question regarding the use of the FieldInfo object.
I'm using the FieldInfo object, calling the GetValue(object) method. The
object that I'm passing to the method is only partially populated, so
some of the fields are uninitialized (null). However when the
FieldInfo.GetValue(object) returns the value, uninitialized integers
(which I had hoped would still be null) are returned as 0 and
uninitialized bools (which should be null also) are returned as false,
null strings however are returned properly. Has anyone else run into a
similar problem? Should I not be expecting FieldInfo.GetValue to return
uninitialized ints and bools as null? Any help would be great.

- Phil