Skip to content

Fix LT-22295: Don't crash if MakeDefaultSelection is called early#484

Merged
jasonleenaylor merged 1 commit into
release/9.3from
bugfix/LT-22295_93
Oct 8, 2025
Merged

Fix LT-22295: Don't crash if MakeDefaultSelection is called early#484
jasonleenaylor merged 1 commit into
release/9.3from
bugfix/LT-22295_93

Conversation

@jasonleenaylor

@jasonleenaylor jasonleenaylor commented Oct 7, 2025

Copy link
Copy Markdown
Contributor

This change is Reviewable

Copilot AI review requested due to automatic review settings October 7, 2025 16:53

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

Fixes a crash in the FocusBoxController when MakeDefaultSelection is called before InterlinWordControl is initialized. The fix adds null checking and defers the operation to the idle queue if the control is not ready yet.

  • Added null checking for InterlinWordControl before calling MakeDefaultSelection
  • Implemented deferred execution using the idle queue when the control is not yet available
  • Used null-conditional operator for safety in the deferred callback

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Comment on lines +328 to +329
InterlinWordControl?.MakeDefaultSelection();
return true;

Copilot AI Oct 7, 2025

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The lambda function always returns true regardless of whether MakeDefaultSelection() was actually called. Consider returning a meaningful value that indicates whether the operation was successful, or add error handling if the InterlinWordControl is still null when the deferred operation executes.

Suggested change
InterlinWordControl?.MakeDefaultSelection();
return true;
if (InterlinWordControl != null)
{
InterlinWordControl.MakeDefaultSelection();
return true;
}
else
{
// Optionally log or handle the error here.
// System.Diagnostics.Debug.WriteLine("InterlinWordControl is still null in deferred MakeDefaultSelection.");
return false;
}

Copilot uses AI. Check for mistakes.

@mark-sil mark-sil left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mark-sil reviewed 1 of 1 files at r1, all commit messages.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @jasonleenaylor)

@mark-sil mark-sil left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @jasonleenaylor)

@jasonleenaylor jasonleenaylor merged commit 5d03fe1 into release/9.3 Oct 8, 2025
4 of 5 checks passed
@jasonleenaylor jasonleenaylor deleted the bugfix/LT-22295_93 branch October 8, 2025 15:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants