Skip to content

Commit

Permalink
refactor: relax url validation for href attribute
Browse files Browse the repository at this point in the history
  • Loading branch information
ekashida committed May 1, 2019
1 parent 8b29f4e commit f0484df
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions packages/@lwc/engine/src/framework/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -674,10 +674,12 @@ export function gid(id: string | undefined | null): string | null | undefined {
export function fid(url: string | undefined | null): string | null | undefined {
if (isUndefined(url) || url === '') {
if (process.env.NODE_ENV !== 'production') {
assert.logError(
`Invalid url value "${url}". Expected a non-empty string.`,
vmBeingRendered!.elm
);
if (isUndefined(url)) {
assert.logError(
`Undefined url value for "href" or "xlink:href" attribute. Expected a non-empty string.`,
vmBeingRendered!.elm
);
}
}
return url;
}
Expand Down

0 comments on commit f0484df

Please sign in to comment.