diff --git a/SafeExamBrowser.UserInterface.Desktop/Windows/Taskbar.xaml.cs b/SafeExamBrowser.UserInterface.Desktop/Windows/Taskbar.xaml.cs index 78ad173b..6e823b3e 100644 --- a/SafeExamBrowser.UserInterface.Desktop/Windows/Taskbar.xaml.cs +++ b/SafeExamBrowser.UserInterface.Desktop/Windows/Taskbar.xaml.cs @@ -89,7 +89,7 @@ namespace SafeExamBrowser.UserInterface.Desktop.Windows { Activate(); - if (forward) + if (forward && ApplicationStackPanel.Children.Count > 0) { SetFocusWithin(ApplicationStackPanel.Children[0]); } diff --git a/SafeExamBrowser.UserInterface.Mobile/Windows/Taskbar.xaml.cs b/SafeExamBrowser.UserInterface.Mobile/Windows/Taskbar.xaml.cs index 24040923..e64d3b8b 100644 --- a/SafeExamBrowser.UserInterface.Mobile/Windows/Taskbar.xaml.cs +++ b/SafeExamBrowser.UserInterface.Mobile/Windows/Taskbar.xaml.cs @@ -88,7 +88,7 @@ namespace SafeExamBrowser.UserInterface.Mobile.Windows { Activate(); - if (fromTop) + if (fromTop && ApplicationStackPanel.Children.Count > 0) { ApplicationStackPanel.Children[0].Focus(); }