asiftasleem / nbuilder

Automatically exported from code.google.com/p/nbuilder
0 stars 0 forks source link

should verify GetGetMethod != null #27

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Put an object with a Property (Units) and a set only ( write only property)
2. try to construct with nbuilder
3. trace is 
Units threw an exception when attempting to read its current value

In the code at Property Namer it is:

 if (memberInfo is PropertyInfo)
            {
                try
                {
                    currentValue = ((PropertyInfo)memberInfo).GetValue(obj,
null);
                }
                catch (Exception)
                {
                    Trace.WriteLine(string.Format("{0} threw an exception
when attempting to read its current value", memberInfo.Name));
                }
            }

Please verify that get method exists :
  try
                {
if((PropertyInfo)memberInfo).GetGetMethod != null)
{

                    currentValue = ((PropertyInfo)memberInfo).GetValue(obj,
null);

}
                }

Original issue reported on code.google.com by ignat.an...@gmail.com on 24 Jul 2009 at 10:04

GoogleCodeExporter commented 8 years ago
Reproduced and fixed.

It will be included in the next release which is coming very soon.

Thanks for reporting it. 

Original comment by garethdo...@googlemail.com on 23 Sep 2009 at 9:25

GoogleCodeExporter commented 8 years ago

Original comment by garethdo...@googlemail.com on 23 Sep 2009 at 9:28