Skip to content

Commit 646c0ee

Browse files
zeusongitQilongTang
authored andcommitted
DYN-8749 Handle crash when closing splash screen after DynamoView load (#16175)
1 parent 1bb9a62 commit 646c0ee

2 files changed

Lines changed: 13 additions & 5 deletions

File tree

src/DynamoCore/Models/DynamoModel.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1463,7 +1463,7 @@ public void Dispose()
14631463
}
14641464

14651465
// Lucene disposals (just if LuceneNET was initialized)
1466-
LuceneUtility.DisposeAll();
1466+
LuceneUtility?.DisposeAll();
14671467

14681468
#if DEBUG
14691469
CurrentWorkspace.NodeAdded -= CrashOnDemand.CurrentWorkspace_NodeAdded;

src/DynamoCoreWpf/Views/SplashScreen/SplashScreen.xaml.cs

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -407,11 +407,19 @@ internal async void SetBarProperties(string version, string loadingDescription,
407407

408408
internal async void SetLoadingDone()
409409
{
410-
if (webView?.CoreWebView2 != null)
410+
try
411+
{
412+
if (webView?.CoreWebView2 != null)
413+
{
414+
await webView.CoreWebView2.ExecuteScriptAsync($"window.setLoadingDone()");
415+
await webView.CoreWebView2.ExecuteScriptAsync($"window.setTotalLoadingTime(\"{Wpf.Properties.Resources.SplashScreenTotalLoadingTimeLabel} {totalLoadingTime}ms\")");
416+
SetSignInEnable(enableSignInButton);
417+
}
418+
}
419+
catch (Exception ex)
411420
{
412-
await webView.CoreWebView2.ExecuteScriptAsync($"window.setLoadingDone()");
413-
await webView.CoreWebView2.ExecuteScriptAsync($"window.setTotalLoadingTime(\"{Wpf.Properties.Resources.SplashScreenTotalLoadingTimeLabel} {totalLoadingTime}ms\")");
414-
SetSignInEnable(enableSignInButton);
421+
Console.WriteLine(ex.Message);
422+
return;
415423
}
416424
}
417425

0 commit comments

Comments
 (0)