diff --git a/Assets/Cryville/Common/Pdt/PdtInterpreter.cs b/Assets/Cryville/Common/Pdt/PdtInterpreter.cs index ad6f6af..7eebc51 100644 --- a/Assets/Cryville/Common/Pdt/PdtInterpreter.cs +++ b/Assets/Cryville/Common/Pdt/PdtInterpreter.cs @@ -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);