Skip to content

Commit

Permalink
Catch null text.
Browse files Browse the repository at this point in the history
  • Loading branch information
wizgod committed Aug 29, 2023
1 parent f0b0230 commit b4f5e99
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 @@ -66,7 +66,7 @@ export class GalleryDirectoryComponent implements OnInit, OnDestroy {
}

replaceUnderscore(text: string): string {
return text.replaceAll('_', ' ').trim()
return text?.replaceAll('_', ' ').trim() ?? ''
}
}

Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ export class GalleryPhotoComponent implements IRenderable, OnInit, OnDestroy {
}

toTitle(text: string): string {
text = text.replaceAll('_', ' ');
text = text?.replaceAll('_', ' ') ?? '';
// Strip the extension.
return (text.substring(0, text.lastIndexOf('.')) || text).trim();
}
Expand Down

0 comments on commit b4f5e99

Please sign in to comment.