diff --git a/lib/Service/MediaPlaceManager.php b/lib/Service/MediaPlaceManager.php index c69cf2754..eaf9a2252 100644 --- a/lib/Service/MediaPlaceManager.php +++ b/lib/Service/MediaPlaceManager.php @@ -61,9 +61,12 @@ public function getPlaceForFile(int $fileId): ?string { $coordinate = $metadata->getArray('photos-gps'); - $latitude = $coordinate['latitude']; - $longitude = $coordinate['longitude']; + $latitude = $coordinate['latitude'] ?? null; + $longitude = $coordinate['longitude'] ?? null; + if ($latitude === null || $longitude === null) { + return null; + } - return $this->rgcService->getPlaceForCoordinates($latitude, $longitude); + return $this->rgcService->getPlaceForCoordinates((float) $latitude, (float) $longitude); } }