fix: handle missing concluded license in project license summary card#611
Merged
Conversation
Skip packages with undefined `concluded` field in `countMoreRestrictiveThan()` to prevent React crash when rendering Cargo workspace reports with local path dependencies that have no license data from deps.dev. Fixes: TC-4504 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Reviewer's guide (collapsed on small PRs)Reviewer's GuideAdds a null check for missing concluded license data in the project license summary card to prevent crashes when rendering HTML reports, and regenerates the bundled main.js asset accordingly. Flow diagram for updated countMoreRestrictiveThan null checkflowchart TD
A[SummaryCard render] --> B[getCategoryRank projectCategory]
B --> C[countMoreRestrictiveThan]
C --> D[Iterate packages]
D --> E{p.concluded exists?}
E -- No --> D
E -- Yes --> F[getCategoryRank p.concluded.category]
F --> G{packageRank < projectRank}
G -- Yes --> H[Increment count]
G -- No --> D
H --> D
D --> I[Return count]
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
ruromero
approved these changes
May 19, 2026
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.
Summary
TypeError: Cannot read properties of undefined (reading 'category')crash in the HTML report when analyzing Cargo workspace projects with local path dependencies and a project license definedp.concludedincountMoreRestrictiveThan()inSummaryCard.tsxbefore accessing.categoryRoot Cause
The
countMoreRestrictiveThan()function inSummaryCard.tsxiterates all packages in the license report and accessesp.concluded.categorywithout checking ifconcludedexists. For Cargo workspace local path dependencies (repository_url=local), deps.dev cannot resolve license data, soconcludedisundefined. When a project license is also defined (e.g.license = "MIT"in Cargo.toml), the Project License card renders and calls this function, causing the React app to crash with no error boundary — resulting in a blank/black page in the VS Code webview.Test plan
nautilus_trader(large Cargo workspace with 42 local path deps andlicense = "LGPL-3.0-or-later")[workspace.package] licensefieldFixes: TC-4504
🤖 Generated with Claude Code
Summary by Sourcery
Bug Fixes: