MINOR: Edit-case checking of data in ViewableData::$failover for better error message. (from r95560) (from r98090)

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@102582 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
Ingo Schommer 2010-04-13 02:02:18 +00:00
parent 8ec4c25be7
commit 72bb124951

View File

@ -188,7 +188,8 @@ class ViewableData extends Object implements IteratorAggregate {
*/
public function defineMethods() {
if($this->failover) {
$this->addMethodsFrom('failover');
if(is_object($this->failover)) $this->addMethodsFrom('failover');
else user_error("ViewableData::\$failover set to a non-object", E_USER_WARNING);
if(isset($_REQUEST['debugfailover'])) {
Debug::message("$this->class created with a failover class of {$this->failover->class}");