fix(handbook): handle empty maintainer links in repository-overview#7266
Open
ssam18 wants to merge 2 commits intolayer5io:masterfrom
Open
fix(handbook): handle empty maintainer links in repository-overview#7266ssam18 wants to merge 2 commits intolayer5io:masterfrom
ssam18 wants to merge 2 commits intolayer5io:masterfrom
Conversation
When a repository has a vacant maintainer position, the link array contains an empty string [''], causing Link components to render with empty 'to' props. This produces console errors about null page references. This fix adds conditional rendering to check if the maintainer link exists and is non-empty before rendering a Link component. When the link is empty, a plain span is rendered instead, preventing the null reference error. Fixes layer5io#6472 Signed-off-by: Samaresh Kumar Singh <[email protected]>
Contributor
|
🚀 Preview for commit bbf1218 at: https://694478428bfdfa2613af4052--layer5.netlify.app |
Contributor
|
@ssam18 |
Contributor
|
🚀 Preview for commit 483b090 at: https://696f8ffaf6c1936198209973--layer5.netlify.app |
|
Sorry I couldn't join the call today. It was early morning. I will take a look on this and leave my comments for further clarification |
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.
Description
When visiting the repository overview handbook page, console errors appear about null page references.
Root Cause
Several repositories in
repo-data.jshave vacant maintainer positions with empty string links (link: [""]). When these are rendered, the<Link to="">component produces a null page reference error.Solution
Added conditional rendering in the maintainer mapping function:
<Link>component as before<span>element insteadThis prevents the null reference error while still displaying the maintainer name ("Vacant") correctly.
Testing
Fixes #6472