Router might be undefined added safe check (#4198)

This commit is contained in:
MichalKinas 2024-10-24 09:17:43 +02:00 committed by GitHub
parent 3fbdc93c51
commit 093099d990
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -220,11 +220,11 @@ export class SearchInputComponent implements OnInit, OnDestroy {
} }
get onLibrariesSearchResults() { get onLibrariesSearchResults() {
return this.router.url.indexOf('/search-libraries') === 0; return this.router?.url.indexOf('/search-libraries') === 0;
} }
get onSearchResults() { get onSearchResults() {
return !this.onLibrariesSearchResults && this.router.url.indexOf('/search') === 0; return !this.onLibrariesSearchResults && this.router?.url.indexOf('/search') === 0;
} }
isFilesChecked(): boolean { isFilesChecked(): boolean {