diff --git a/SafeExamBrowser.UserInterface.Desktop/Windows/Taskbar.xaml.cs b/SafeExamBrowser.UserInterface.Desktop/Windows/Taskbar.xaml.cs index 78ad173b..e1937348 100644 --- a/SafeExamBrowser.UserInterface.Desktop/Windows/Taskbar.xaml.cs +++ b/SafeExamBrowser.UserInterface.Desktop/Windows/Taskbar.xaml.cs @@ -91,7 +91,10 @@ namespace SafeExamBrowser.UserInterface.Desktop.Windows if (forward) { - SetFocusWithin(ApplicationStackPanel.Children[0]); + if (ApplicationStackPanel.Children.Count > 0) + { + SetFocusWithin(ApplicationStackPanel.Children[0]); + } } else { diff --git a/SafeExamBrowser.UserInterface.Mobile/Windows/Taskbar.xaml.cs b/SafeExamBrowser.UserInterface.Mobile/Windows/Taskbar.xaml.cs index 24040923..18f4665b 100644 --- a/SafeExamBrowser.UserInterface.Mobile/Windows/Taskbar.xaml.cs +++ b/SafeExamBrowser.UserInterface.Mobile/Windows/Taskbar.xaml.cs @@ -90,7 +90,10 @@ namespace SafeExamBrowser.UserInterface.Mobile.Windows if (fromTop) { - ApplicationStackPanel.Children[0].Focus(); + if (ApplicationStackPanel.Children.Count > 0) + { + ApplicationStackPanel.Children[0].Focus(); + } } else {