fix(handbook): handle empty maintainer links in repository-overview#7266
fix(handbook): handle empty maintainer links in repository-overview#7266ssam18 wants to merge 3 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 <ssam3003@gmail.com>
|
🚀 Preview for commit bbf1218 at: https://694478428bfdfa2613af4052--layer5.netlify.app |
|
@ssam18 |
|
🚀 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 |
|
🚀 Preview for commit 536e354 at: https://69c460b2ff5d63e27c880eca--layer5.netlify.app |
|
is there anything pending for this PR? |
|
This console.log errors no longer appear in the handbook page. Hence closing this PR |
|
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