Skip to content

Commit

Permalink
Добавлена проверка на отсутствие JS объекта
Browse files Browse the repository at this point in the history
  • Loading branch information
Mirocow committed Oct 17, 2014
1 parent 88f71e9 commit ca9d65c
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions mirocow/yandexmaps/Api.php
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,7 @@ public function generateGeoObjectCollection(GeoObjectCollection $object, $var =

if (count($object->objects) > 0) {
foreach ($object->objects as $object) {
if(!$object) continue;
if (is_object($object)) {
$object = $this->generateObject($object);
}
Expand Down Expand Up @@ -171,7 +172,8 @@ public function generateMap(Map $map, $var = null)
$objects = '';
$clusterer = "var points = [];\n";

foreach ($map->objects as $i => $object) {
foreach ($map->objects as $i => $object) {
if(!$object) continue;
if (!is_string($object) && !$object instanceof GeoObject) {
if ($objBegin) {
$jsObj[] = $object;
Expand Down Expand Up @@ -199,7 +201,7 @@ public function generateMap(Map $map, $var = null)
}

} elseif(is_string($object)) {
$js .= "$object;\n";
$js .= "$object;\n";
}
}
}
Expand Down

0 comments on commit ca9d65c

Please sign in to comment.