Avoid error in case $date is not set

This commit is contained in:
Nathan Gray 2015-05-05 23:35:01 +00:00
parent 211efdda68
commit 2122f7db0f

View File

@ -210,7 +210,7 @@ class etemplate_widget_date extends etemplate_widget_transformer
$valid = $date->format('ts');
}
// string with formatting letters like for php's date() method
elseif (($valid = $date->format($this->attrs['dataformat'])))
elseif ($date && ($valid = $date->format($this->attrs['dataformat'])))
{
// Nothing to do here
}