Skip to content

Commit

Permalink
fix: Fix nullable collection on Geocoder::reverse
Browse files Browse the repository at this point in the history
This fix is from @rewebcan, see PR cheesegrits#106 on original repo.
  • Loading branch information
Heyian committed Aug 28, 2024
1 parent b566f67 commit 2d91ebb
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Helpers/Geocoder.php
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ public function geocodeQuery(string $address): Collection

public function reverse(array|string $lat, ?string $lng = null): string
{
$result = $this->reverseQuery(MapsHelper::getLatLng($lat, $lng))->first();
$result = $this->reverseQuery(MapsHelper::getLatLng($lat, $lng))?->first();

if ($result) {
return $result->getFormattedAddress();
Expand Down

0 comments on commit 2d91ebb

Please sign in to comment.