fix: avoid issues with incomplete xml data
This commit is contained in:
@@ -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