Repository navigation
refactor: stop relying on null from template safe navigation - #3631
Merged
Merged
Conversation
This was referenced Oct 12, 2026
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
The new undefined-size fallback lacks a focused regression test.
1 open finding
What changed in this PR
Updates template behavior for Angular 22’s undefined safe-navigation semantics.
Changes:
- Defaults missing disk sizes to zero.
- Accesses the typed CIRA form control directly.
| File | Description |
|---|---|
profile-detail.component.html |
Removes unnecessary safe navigation for the CIRA control. |
hardware-information.component.ts |
Handles missing media sizes without producing NaN GB. |
🧠 Review effort: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
This was referenced Oct 12, 2026
rsdmike
added this pull request to stack #3635
October 12, 2026 23:03
madhavilosetty-intel
approved these changes
Oct 13, 2026
rsdmike
force-pushed
the
refactor/template-safe-navigation
branch
from
October 13, 2026 15:29
db3258d to
94ea97c
Compare
Angular 22 makes `?.` in templates evaluate to undefined, as it does in JavaScript, where earlier versions produced null. The disk size formatter treats a missing size as zero, so it keeps printing "0 GB" where undefined would give "NaN GB". The profile form reads the CIRA config control directly when checking for null instead of going through an optional chain.
calculateMediaSize falls back to zero when the template's optional chain yields undefined, so assert that it returns "0 GB" for it.
rsdmike
force-pushed
the
refactor/template-safe-navigation
branch
from
October 13, 2026 15:36
94ea97c to
f6c78d6
Compare
|
🎉 This PR is included in version 3.70.0 🎉 The release is available on:
Your semantic-release bot 📦🚀 |
|
🎉 This PR is included in version 3.70.0 🎉 The release is available on:
Your semantic-release bot 📦🚀 |
5 tasks done
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.

Angular 22 makes
?.in templates evaluate toundefined, as it does in JavaScript, where earlier versions producednull.The disk size formatter treats a missing size as zero, so it keeps printing "0 GB" where
undefinedwould give "NaN GB". The profile form reads the CIRA config control directly when checking for null instead of going through an optional chain.PR Checklist
What are you changing?
Anything the reviewer should know when reviewing this PR?
If the there are associated PRs in other repositories, please link them here (i.e. device-management-toolkit/repo#365 )