From c41c9079caeeae3db74fd424446b3a1f9a871aea Mon Sep 17 00:00:00 2001 From: Aaron Spettl Date: Thu, 11 Jan 2024 13:14:51 +0100 Subject: [PATCH] Fix possible exception depending on clipboard content --- WordsLive/Editor/EditorWindow.xaml.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/WordsLive/Editor/EditorWindow.xaml.cs b/WordsLive/Editor/EditorWindow.xaml.cs index 58ab8bc7..16802f47 100644 --- a/WordsLive/Editor/EditorWindow.xaml.cs +++ b/WordsLive/Editor/EditorWindow.xaml.cs @@ -395,7 +395,7 @@ private void OnCommandCanExecute(object sender, CanExecuteRoutedEventArgs e) { string text = Clipboard.GetText(); var firstNewline = text.IndexOf('\n'); - if (firstNewline > 0 && text.Length >= firstNewline + 1) + if (firstNewline > 0 && text.Length >= firstNewline + 2) { var next = text[firstNewline + 1]; e.CanExecute = (next == '\n' || next == '\r') && text.Contains("CCLI");