Fix error on element/property list is null.
This commit is contained in:
@@ -271,7 +271,9 @@ namespace Cryville.Common.Pdt {
|
||||
if (prop == null) throw new MissingMemberException(string.Format("The property \"{0}\" is not found", pkey));
|
||||
Type ptype = ReflectionHelper.GetMemberType(prop);
|
||||
if (flag) {
|
||||
using (var collection = new PairCollection(ReflectionHelper.GetValue(prop, result))) {
|
||||
var origCollection = ReflectionHelper.GetValue(prop, result);
|
||||
if (origCollection == null) origCollection = Activator.CreateInstance(ptype);
|
||||
using (var collection = new PairCollection(origCollection)) {
|
||||
var ktype = ptype.GetGenericArguments()[0];
|
||||
var vtype = ptype.GetGenericArguments()[1];
|
||||
object key = _binder.ChangeType(pkey, ktype, null);
|
||||
|
Reference in New Issue
Block a user