Fixes #9915: yii\helpers\ArrayHelper::getValue() was erroring instead of returning null for non-existing object properties

This commit is contained in:
Vadim
2015-10-14 12:36:33 +03:00
committed by Alexander Makarov
parent c128d008d3
commit c00b97a12c
3 changed files with 9 additions and 1 deletions

View File

@ -198,7 +198,7 @@ class BaseArrayHelper
$key = substr($key, $pos + 1);
}
if (is_object($array)) {
if (is_object($array) && isset($array->$key)) {
return $array->$key;
} elseif (is_array($array)) {
return array_key_exists($key, $array) ? $array[$key] : $default;