From def96c0460b0c411ad5c17b959c50d2d7b91cc0d Mon Sep 17 00:00:00 2001 From: AD7six Date: Tue, 24 Jan 2012 13:54:39 +0100 Subject: [PATCH] throw an exception if the view you try to extend doesn't exist or element, or layout --- lib/Cake/View/View.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/Cake/View/View.php b/lib/Cake/View/View.php index db5db15b1..53c04f723 100644 --- a/lib/Cake/View/View.php +++ b/lib/Cake/View/View.php @@ -679,6 +679,10 @@ class View extends Object { break; } + + if (!$parent) { + throw new LogicException(__d('cake_dev', 'The parent %s you specified doesn\'t exist.', $this->_currentType)); + } if ($parent == $this->_current) { throw new LogicException(__d('cake_dev', 'You cannot have views extend themselves.')); }