Use default( ) instead of null for model value (#10435)

This commit is contained in:
Jose Marcenaro
2021-06-11 09:17:12 -03:00
committed by GitHub
parent 0b3eeafb47
commit 20f3b223c5

View File

@@ -228,7 +228,7 @@ namespace Umbraco.Cms.Web.Common.Views
// if not possible or it is not generic then we need to create a new ViewDataDictionary
Type nViewDataType = typeof(ViewDataDictionary<>).MakeGenericType(modelType);
var tViewData = new ViewDataDictionary(viewData) { Model = null }; // temp view data to copy values
var tViewData = new ViewDataDictionary(viewData) { Model = default(TModel) }; // temp view data to copy values
var nViewData = (ViewDataDictionary)Activator.CreateInstance(nViewDataType, tViewData);
return nViewData;
}