Skip to content

Conversation

@johnml1135
Copy link

@johnml1135 johnml1135 commented Jan 29, 2026

Add an early IsDisposed check to prevent accessing UI state (LastActivityTime) when the service has been disposed but the timer event still fires.


This change is Reviewable

Add an early IsDisposed check to prevent accessing UI state (LastActivityTime)
when the service has been disposed but the timer event still fires.
Copilot AI review requested due to automatic review settings January 29, 2026 20:50
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR fixes a NullReferenceException that occurs when the UnitOfWorkService's SaveOnIdle timer callback accesses the UI state (LastActivityTime) after the service has been disposed. The fix adds an early IsDisposed check after acquiring the lock but before accessing m_ui, preventing the exception from occurring.

Changes:

  • Added IsDisposed check in SaveOnIdle method to prevent accessing m_ui.LastActivityTime when disposed

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Contributor

@jtmaxwell3 jtmaxwell3 left a comment

Choose a reason for hiding this comment

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

:lgtm:

@jtmaxwell3 made 1 comment.
Reviewable status: 0 of 1 files reviewed, all discussions resolved.

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.

2 participants