Skip to content

Commit 913a862

Browse files
DYN-9071 Dynamo - DynamoPlayer - SplashScreen Crash
This error happens when the user follow the next steps: - open Dynamo. - open DynamoPlayer. - choose a script in player. - close Dynamo and quickly (when the hourglass cursor is still shown) click Dynamo button, then get a crash and the SplashScreen stays frozen. So as a workaround I added some code in Dynamo SplashScreen that will show a messagebox saying that SplashScreen was not initialized correctly, then after the user clicks Ok, then will close the SplashScreen, in this way, we won't get the crash and the SplashScreen will be closed.
1 parent acd8948 commit 913a862

File tree

4 files changed

+53
-8
lines changed

4 files changed

+53
-8
lines changed

src/DynamoCoreWpf/Properties/Resources.Designer.cs

Lines changed: 24 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/DynamoCoreWpf/Properties/Resources.en-US.resx

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4241,4 +4241,10 @@ To open this graph in Dynamo 3.3–3.6.x: Install the PythonNet package from the
42414241
<data name="ToastHyperlinkPathText" xml:space="preserve">
42424242
<value>here</value>
42434243
</data>
4244-
</root>
4244+
<data name="DynamoSplashScreen" xml:space="preserve">
4245+
<value>Dynamo Splash Screen</value>
4246+
</data>
4247+
<data name="DynamoSplashScreenFailed" xml:space="preserve">
4248+
<value>Failed to load splash content</value>
4249+
</data>
4250+
</root>

src/DynamoCoreWpf/Properties/Resources.resx

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4228,4 +4228,10 @@ To open this graph in Dynamo 3.3–3.6.x: Install the PythonNet package from the
42284228
<data name="ToastHyperlinkPathText" xml:space="preserve">
42294229
<value>here</value>
42304230
</data>
4231-
</root>
4231+
<data name="DynamoSplashScreen" xml:space="preserve">
4232+
<value>Dynamo Splash Screen</value>
4233+
</data>
4234+
<data name="DynamoSplashScreenFailed" xml:space="preserve">
4235+
<value>Failed to load splash content</value>
4236+
</data>
4237+
</root>

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

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
using Dynamo.Core;
1313
using Dynamo.Logging;
1414
using Dynamo.Models;
15+
using Dynamo.UI.Prompts;
1516
using Dynamo.Utilities;
1617
using Dynamo.ViewModels;
1718
using Dynamo.Wpf.Utilities;
@@ -132,6 +133,20 @@ public void OnRequestDynamicSplashScreen()
132133
/// </summary>
133134
public void OnRequestStaticSplashScreen()
134135
{
136+
if (viewModel == null)
137+
{
138+
Dispatcher.Invoke(() =>
139+
{
140+
DynamoMessageBox.Show(
141+
owner: this,
142+
messageBoxText: Wpf.Properties.Resources.DynamoSplashScreenFailed,
143+
caption: Wpf.Properties.Resources.DynamoSplashScreen,
144+
MessageBoxButton.OK,
145+
MessageBoxImage.Warning
146+
);
147+
});
148+
this.Close();
149+
}
135150
StaticSplashScreenReady?.Invoke();
136151
}
137152

0 commit comments

Comments
 (0)