Skip to content

Fix Copilot review findings: null-safety, dash encoding, delegate mismatch - #366

Merged
MayaKirova merged 2 commits into
mkirova/nullablefrom
copilot/fix-comments-in-review-thread
Aug 25, 2026
Merged

Fix Copilot review findings: null-safety, dash encoding, delegate mismatch#366
MayaKirova merged 2 commits into
mkirova/nullablefrom
copilot/fix-comments-in-review-thread

Conversation

Copilot AI commented Aug 25, 2026

Copy link
Copy Markdown
Contributor

Addresses the review comments left on the nullable-reference-types enablement PR: unguarded null-forgiving operators that can throw at runtime, a corrupted doc-comment character, unnecessarily nullable members, and a delegate guard/invoke mismatch.

Null-safety fixes

  • Chat.stories.razor: OnBasicMessageCreated/OnTemplateMessageCreated guard against a null args.Detail instead of dereferencing it with !; Text falls back to string.Empty.
  • WebViewCallback.cs: AdjustDynamicContentBatch checks the deserialized array for null before iterating, and uses ?. instead of ! when invoking on a possibly-missing target control.

Tightened nullability contracts

  • DataAdapters.cs: LocalJson.From, _json, and Json are non-nullable — they're always initialized via the constructor, so the nullability was misleading.
  • IgbTemplateContent.razor: Context reverted to non-nullable T (with a defensively-initialized backing field), matching DynamicContentInfo<T>.UpdateContext's existing non-null assumption. DynamicContentHolder.cs updated accordingly.

Bug fix

  • RuntimeHelper.cs: SendUnmarshalledColumnDataIntentsMessage was checking _callSendUnmarshalledColumnMessage but invoking the different _callSendUnmarshalledColumnDataIntentMessage delegate. Now guards on the delegate it actually calls.

Cosmetic

  • IconButton.cs: Replaced corrupted replacement-character bytes () in an XML doc comment with proper en-dash () characters.

Co-authored-by: MayaKirova <10397980+MayaKirova@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix code based on all comments in review thread Fix Copilot review findings: null-safety, dash encoding, delegate mismatch Aug 25, 2026
Copilot AI requested a review from MayaKirova August 25, 2026 13:40
@MayaKirova
MayaKirova marked this pull request as ready for review August 25, 2026 13:45
Copilot AI lite review requested due to automatic review settings August 25, 2026 13:45

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

This PR updates the Ignite UI for Blazor library (and its Blazing Story demos) to address prior review findings around nullable reference types: removing unsafe null-forgiving dereferences, tightening nullability contracts where values are always initialized, fixing a delegate guard/invoke mismatch in JS interop, and correcting a corrupted XML-doc character.

Changes:

  • Hardened null-safety in chat story handlers and dynamic-content batch processing to avoid runtime NullReferenceExceptions.
  • Tightened nullability contracts for LocalJson and IgbTemplateContent<T>.Context to match actual initialization/usage assumptions.
  • Fixed RuntimeHelper.SendUnmarshalledColumnDataIntentsMessage to guard the delegate it actually invokes, and corrected an XML doc en-dash.

Reviewed changes

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

Show a summary per file
File Description
stories/Components/Stories/Chat.stories.razor Adds null guards for args.Detail and safe Text fallback when building agent replies.
src/componentsBase/WebViewCallback.cs Adds a null-check for the deserialized batch array and avoids null-forgiving invocation when locating target controls.
src/componentsBase/RuntimeHelper.cs Fixes delegate guard/invoke mismatch for unmarshalled “data intents” calls.
src/componentsBase/IgbTemplateContent.razor Makes Context non-nullable and removes null-forgiving usage in template rendering.
src/componentsBase/DynamicContentHolder.cs Updates assignment to IgbTemplateContent<T>.Context to align with non-nullable Context.
src/componentsBase/DataAdapters.cs Makes LocalJson.From, backing field, and Json property non-nullable and removes unnecessary null-forgiving.
src/components/Blazor/IconButton.cs Replaces corrupted XML-doc characters with a proper en-dash.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@MayaKirova
MayaKirova merged commit d0a62ac into mkirova/nullable Aug 25, 2026
7 of 8 checks passed
@MayaKirova
MayaKirova deleted the copilot/fix-comments-in-review-thread branch August 25, 2026 13:50
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