Skip to content

Commit

Permalink
Fix TypeError with invalid coordinates (fix #2187)
Browse files Browse the repository at this point in the history
Signed-off-by: Varun Patil <[email protected]>
  • Loading branch information
pulsejet authored and backportbot-nextcloud[bot] committed Dec 20, 2023
1 parent 7ced978 commit 3621ace
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 3621ace

Please sign in to comment.