Added sanity check for variable

I like to remove the password field from records when I'm not using the password value, this caused an error when creating the cache keys.
This commit is contained in:
Josh Sherman 2013-09-11 10:28:38 -04:00
parent 9dcf3fa58e
commit 4819b2c1a2

View file

@ -1447,7 +1447,7 @@ class Model extends Object
foreach ($this->original[0] as $column => $value) foreach ($this->original[0] as $column => $value)
{ {
if (!String::isEmpty($value) && !in_array($column, $this->columns) if (!String::isEmpty($value) && !in_array($column, $this->columns)
&& $value != $this->record[$column]) && isset($this->record[$column]) && $value != $this->record[$column])
{ {
$cache_keys[] = $this->model . '-' . $column . '-' . $value; $cache_keys[] = $this->model . '-' . $column . '-' . $value;
} }