diff --git a/Analogy.CommonControls/Tools/JsonTreeView.cs b/Analogy.CommonControls/Tools/JsonTreeView.cs index 2321b045..0583153b 100644 --- a/Analogy.CommonControls/Tools/JsonTreeView.cs +++ b/Analogy.CommonControls/Tools/JsonTreeView.cs @@ -366,8 +366,11 @@ public async Task ShowJson(string jsonString) cancellationTokenSource?.Cancel(); cancellationTokenSource = new CancellationTokenSource(); var token = cancellationTokenSource.Token; - object json = JsonConvert.DeserializeObject(jsonString); - var nodes = await Task.Run(() => LoadTree(json, token)); + var nodes = await Task.Run(() => + { + object json = JsonConvert.DeserializeObject(jsonString); + return LoadTree(json, token); + }); if (nodes.valid) { Nodes.AddRange(nodes.result.ToArray());