From 93e1fd3ebd387e92d9ba649ba8c6e36f284f0036 Mon Sep 17 00:00:00 2001 From: ScrubN <72096833+ScrubN@users.noreply.github.com> Date: Tue, 27 Aug 2024 20:39:23 -0400 Subject: [PATCH] Return early if null --- TwitchDownloaderWPF/WindowSettings.xaml.cs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/TwitchDownloaderWPF/WindowSettings.xaml.cs b/TwitchDownloaderWPF/WindowSettings.xaml.cs index 0a715269..4c735718 100644 --- a/TwitchDownloaderWPF/WindowSettings.xaml.cs +++ b/TwitchDownloaderWPF/WindowSettings.xaml.cs @@ -334,6 +334,10 @@ private void FileNameParameter_MouseDown(object sender, MouseButtonEventArgs e) var focusedElement = Keyboard.FocusedElement; var textBox = GetTemplateTextBox(focusedElement); + + if (textBox is null) + return; + if (textBox.TryInsertAtCaret(parameter)) { e.Handled = true;