Skip to content

Commit

Permalink
fix null dereference
Browse files Browse the repository at this point in the history
  • Loading branch information
anshbansal committed Dec 20, 2024
1 parent 03ab2a3 commit 4b3ec4c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions datahub-web-react/src/app/lineage/utils/titleUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -124,10 +124,10 @@ function truncate(input, length) {
function getLastTokenOfTitle(title?: string): string {
if (!title) return '';

const lastToken = title?.split('.')?.slice(-1)[0];
const lastToken = title?.split('.')?.slice(-1)?.[0];

// if the last token does not contain any content, the string should not be tokenized on `.`
if (lastToken.replace(/\s/g, '').length === 0) {
if (lastToken?.replace(/\s/g, '')?.length === 0) {
return title;
}

Expand Down

0 comments on commit 4b3ec4c

Please sign in to comment.