Skip to content

Commit

Permalink
Merge pull request #26911 from sossost/fix/error-message-final-slash-…
Browse files Browse the repository at this point in the history
…in-title

Fix : Update meta title error handling
  • Loading branch information
ndelangen authored Jul 10, 2024
2 parents f261d3c + f44b889 commit 83ca66d
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions code/core/src/manager-api/lib/stories.ts
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,10 @@ export const transformStoryIndexToStoriesHash = (
const parent = idx > 0 && list[idx - 1];
const id = sanitize(parent ? `${parent}-${name}` : name!);

if (name.trim() === '') {
throw new Error(dedent`Invalid title ${title} ending in slash.`);
}

if (parent === id) {
throw new Error(
dedent`
Expand Down

0 comments on commit 83ca66d

Please sign in to comment.