Skip to content

fix(Continuation): Add null checks to prevent Cannot read properties of null (reading 'getCapabilities')#2209

Merged
marcelklehr merged 1 commit intodevelopfrom
fix/continuation-null-cheks
Mar 20, 2026
Merged

fix(Continuation): Add null checks to prevent Cannot read properties of null (reading 'getCapabilities')#2209
marcelklehr merged 1 commit intodevelopfrom
fix/continuation-null-cheks

Conversation

@marcelklehr
Copy link
Copy Markdown
Member

No description provided.

…of null (reading 'getCapabilities')

Signed-off-by: Marcel Klehr <mklehr@gmx.net>
Copy link
Copy Markdown
Contributor

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 hardens sync continuation/resume logic by adding explicit runtime guards to prevent null/undefined adapter resources from causing crashes during capability negotiation and continuation restore.

Changes:

  • Add precondition checks in SyncProcess.prepareSync() to avoid calling getCapabilities() on a null/undefined resource.
  • Add parameter validation in DefaultSyncProcess.fromJSON() to fail fast when restoring a sync process with missing dependencies.
  • Add guards before attempting to load a pending continuation in Account to avoid restoring with uninitialized resources.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.

File Description
src/lib/strategies/Default.ts Adds runtime validation around capability negotiation and sync-process restoration from JSON.
src/lib/Account.ts Adds guards before resuming a persisted continuation to avoid null-resource crashes.

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

@marcelklehr marcelklehr merged commit e21f319 into develop Mar 20, 2026
38 of 47 checks passed
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