Commits

Inside Zhou committed 531ce45

[bugfix]将所有属性值设为null的方法使用了错误的遍历方式。

  • Participants
  • Parent commits 0885e51

Comments (0)

Files changed (1)

 		/// 将对象所有属性的值设为null。
 		/// </summary>
 		public void Clear() {
-			foreach(var item in this._dict) {
-				this._dict[item.Key] = null;
+			foreach(var attr in this.Attrs) {
+				this._dict[attr] = null;
 			}
 		}
 
 		/// </summary>
 		/// <param name="dy">被合并的目标</param>
 		public void Merge(DyObj dy, DyObjMergeType merge_type = DyObjMergeType.Combine) {
+			if(null == dy) {
+				throw new ArgumentNullException("dy");
+			}
+
 			switch(merge_type) {
 				case DyObjMergeType.Combine:
 					foreach(var kv in dy) {