missing null check causing legacy trees to break if theres no querystring data.

This commit is contained in:
Claus
2017-08-16 13:43:48 +02:00
parent 5fff884798
commit ff29493203

View File

@@ -15,13 +15,16 @@ namespace Umbraco.Web.Trees
public LegacyTreeParams(IEnumerable<KeyValuePair<string, string>> formCollection)
{
var p = TreeRequestParams.FromDictionary(formCollection.ToDictionary(x => x.Key, x => x.Value));
NodeKey = p.NodeKey;
StartNodeID = p.StartNodeID;
ShowContextMenu = p.ShowContextMenu;
IsDialog = p.IsDialog;
DialogMode = p.DialogMode;
FunctionToCall = p.FunctionToCall;
if (formCollection != null)
{
var p = TreeRequestParams.FromDictionary(formCollection.ToDictionary(x => x.Key, x => x.Value));
NodeKey = p.NodeKey;
StartNodeID = p.StartNodeID;
ShowContextMenu = p.ShowContextMenu;
IsDialog = p.IsDialog;
DialogMode = p.DialogMode;
FunctionToCall = p.FunctionToCall;
}
}
public string NodeKey { get; set; }