Skip to content

Commit

Permalink
Merge pull request #2207 from nextcloud/backport/2206/stable28
Browse files Browse the repository at this point in the history
Fix TypeError with invalid coordinates (fix #2187)
  • Loading branch information
skjnldsv authored Dec 21, 2023
2 parents 7ced978 + 3621ace commit 1b9c899
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions lib/Service/MediaPlaceManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}

0 comments on commit 1b9c899

Please sign in to comment.