Skip to content

Commit 97234ca

Browse files
authored
Check if geonames key exists (#1130)
1 parent c0367c2 commit 97234ca

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/Provider/Geonames/Geonames.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -190,6 +190,10 @@ private function executeQuery(string $url, string $locale = null): AddressCollec
190190
return new AddressCollection([]);
191191
}
192192

193+
if (!isset($json->geonames)) {
194+
return new AddressCollection([]);
195+
}
196+
193197
$data = $json->geonames;
194198

195199
if (empty($data)) {

0 commit comments

Comments
 (0)