Skip to content

Commit

Permalink
Fix possible exception depending on clipboard content
Browse files Browse the repository at this point in the history
  • Loading branch information
aspettl authored and Boddlnagg committed Jan 21, 2024
1 parent dc3a4dc commit c41c907
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion WordsLive/Editor/EditorWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down

0 comments on commit c41c907

Please sign in to comment.