[lightning] fix js error when there is no geolocation available

This commit is contained in:
nymkappa
2023-09-18 09:44:22 +02:00
parent 47dd2cbd5d
commit e79c32010d
2 changed files with 6 additions and 1 deletions

View File

@@ -20,6 +20,11 @@ export class GeolocationComponent implements OnChanges {
formattedLocation: string = '';
ngOnChanges(): void {
if (!this.data) {
this.formattedLocation = '-';
return;
}
const city = this.data.city ? this.data.city : '';
const subdivisionLikeCity = this.data.city === this.data.subdivision;
let subdivision = this.data.subdivision;