Skip to content

[Core] Resolve null in event parsing#67

Merged
Wesley-Young merged 1 commit into
mainfrom
resolve-event-parse-null
Sep 24, 2025
Merged

[Core] Resolve null in event parsing#67
Wesley-Young merged 1 commit into
mainfrom
resolve-event-parse-null

Conversation

@Wesley-Young
Copy link
Copy Markdown
Contributor

Make InfoSyncPushService and PushParamsService return empty event objects instead of base.Parse() => null!, which causes unexpected null-related exceptions.

In addition, we'd better re-consider BaseService.Parse method:

protected virtual ValueTask<TResp> Parse(ReadOnlyMemory<byte> input, BotContext context) =>
    ValueTask.FromResult<TResp>(null!);

Copilot AI review requested due to automatic review settings September 24, 2025 01:32
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 fixes null reference exceptions in event parsing by making InfoSyncPushService and PushParamsService return empty event objects instead of calling base.Parse() which returns null!.

Key changes:

  • Replace base.Parse() calls with empty event object instantiation
  • Prevent unexpected null-related exceptions in event handling

Reviewed Changes

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

File Description
Lagrange.Core/Internal/Services/System/PushParamsService.cs Returns new PushParamsEvent() instead of base.Parse()
Lagrange.Core/Internal/Services/System/InfoSyncPushService.cs Returns new InfoSyncPushEvent() instead of base.Parse()

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

Comment thread Lagrange.Core/Internal/Services/System/PushParamsService.cs
Comment thread Lagrange.Core/Internal/Services/System/InfoSyncPushService.cs
@Wesley-Young Wesley-Young merged commit 810ea55 into main Sep 24, 2025
9 checks passed
@Wesley-Young Wesley-Young deleted the resolve-event-parse-null branch September 24, 2025 03:35
Bemly pushed a commit to Bemly/CharonAnchor that referenced this pull request May 3, 2026
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