From bfa1d60dec77d60212fe54e3a9868492aa17075e Mon Sep 17 00:00:00 2001 From: Robert Date: Sat, 20 Aug 2022 16:46:43 +0200 Subject: [PATCH] Profile editor - Fix crash when there are no devices --- .../ProfileEditor/Panels/VisualEditor/VisualEditorView.axaml.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Artemis.UI/Screens/ProfileEditor/Panels/VisualEditor/VisualEditorView.axaml.cs b/src/Artemis.UI/Screens/ProfileEditor/Panels/VisualEditor/VisualEditorView.axaml.cs index 704ad7ab6..28696008f 100644 --- a/src/Artemis.UI/Screens/ProfileEditor/Panels/VisualEditor/VisualEditorView.axaml.cs +++ b/src/Artemis.UI/Screens/ProfileEditor/Panels/VisualEditor/VisualEditorView.axaml.cs @@ -81,7 +81,7 @@ public class VisualEditorView : ReactiveUserControl private void AutoFit(bool skipTransitions) { - if (ViewModel == null) + if (ViewModel == null || !ViewModel.Devices.Any()) return; double left = ViewModel.Devices.Select(d => d.Rectangle.Left).Min();