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

View File

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