Skip to content

Commit

Permalink
fixed get_from_array() get data from null context issue
Browse files Browse the repository at this point in the history
  • Loading branch information
nahid committed Feb 24, 2020
1 parent 8373d94 commit d8ea666
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions helpers/presento.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,10 @@ function get_from_array($map, string $node)
$path = explode('.', $node);

foreach ($path as $val) {
if (!is_array($map)) {
return null;
}

if (!array_key_exists($val, $map)) {
return null;
}
Expand Down

0 comments on commit d8ea666

Please sign in to comment.