fix: avoid issues with incomplete xml data
This commit is contained in:
1 parent
231aaaac9b
commit
9a84ea24d5
1 file changed
+4
@@ -230,6 +230,10 @@ class TravelXmlLoader extends AbstractXmlLoader
|
|||||||
|
|
||||||
public function getRooms(\SimpleXMLElement $xml): array
|
public function getRooms(\SimpleXMLElement $xml): array
|
||||||
{
|
{
|
||||||
|
if (false === isset($xml->zimmer)) {
|
||||||
|
return [];
|
||||||
|
}
|
||||||
|
|
||||||
$rooms = [];
|
$rooms = [];
|
||||||
|
|
||||||
foreach ($xml->zimmer->preis as $item) {
|
foreach ($xml->zimmer->preis as $item) {
|
||||||
|
|||||||
Reference in new issue
Block a user