Reputation: 2720
I have this piece of code:
FieldInfo fi = this.GetType().GetField(StringConstants.UNDERSCORE + phase,
BindingFlags.Instance | BindingFlags.NonPublic);
if (fi != null)
{
itemPhase = fi.GetValue(this) as IItemPhase;
}
if (itemPhase != null)
{
_currentPhase = phase;
_itemVo.Phase = phase;
itemPhase.PreparePhase();
}
FieldInfo fi
gets correct value, so the field was found.
But FieldInfo.GetValue
returns always null:
... and the Type matches:
Anyone knows why?
Upvotes: 1
Views: 1334
Reputation: 30032
Based on the comments, it seems the reference this._buildPhase
is actually pointing to NULL and that's why you're getting this behavior.
Upvotes: 1