Skip to content

Commit

Permalink
fix(graph): prevent missing sourceMaps errors in graph app by using ?…
Browse files Browse the repository at this point in the history
….startsWith
  • Loading branch information
MaxKless committed Apr 17, 2024
1 parent 801a22b commit 920f2e5
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export function selectSourceInfo(
// When the key is a prefix of the filter, we can record it as the root source.
// Use the most specific key for the root "." source value.
// e.g. `targets.build` takes precedence over `targets`
if (!rootKey || key.startsWith(rootKey)) {
if (!rootKey || key?.startsWith(rootKey)) {
rootKey = key;
rootSource = value;
}
Expand Down
2 changes: 1 addition & 1 deletion graph/ui-tooltips/src/lib/sourcemap-info-tooltip.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export function SourcemapInfoToolTip({
// Every other property within in the target has the form `target.${targetName}.${propertyName}
const isTarget = propertyKey.split('.').length === 2;

const docsUrlSlug: string | undefined = plugin.startsWith('@nx/')
const docsUrlSlug: string | undefined = plugin?.startsWith('@nx/')
? plugin.replace('@nx/', '').split('/')[0]
: undefined;

Expand Down

0 comments on commit 920f2e5

Please sign in to comment.