Fix Copilot review findings: null-safety, dash encoding, delegate mismatch - #366
Merged
MayaKirova merged 2 commits intoAug 25, 2026
Merged
Conversation
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
MayaKirova
approved these changes
Aug 25, 2026
Contributor
There was a problem hiding this comment.
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
LocalJsonandIgbTemplateContent<T>.Contextto match actual initialization/usage assumptions. - Fixed
RuntimeHelper.SendUnmarshalledColumnDataIntentsMessageto 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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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/OnTemplateMessageCreatedguard against anullargs.Detailinstead of dereferencing it with!;Textfalls back tostring.Empty.WebViewCallback.cs:AdjustDynamicContentBatchchecks the deserialized array fornullbefore iterating, and uses?.instead of!when invoking on a possibly-missing target control.Tightened nullability contracts
DataAdapters.cs:LocalJson.From,_json, andJsonare non-nullable — they're always initialized via the constructor, so the nullability was misleading.IgbTemplateContent.razor:Contextreverted to non-nullableT(with a defensively-initialized backing field), matchingDynamicContentInfo<T>.UpdateContext's existing non-null assumption.DynamicContentHolder.csupdated accordingly.Bug fix
RuntimeHelper.cs:SendUnmarshalledColumnDataIntentsMessagewas checking_callSendUnmarshalledColumnMessagebut invoking the different_callSendUnmarshalledColumnDataIntentMessagedelegate. 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.