Merge pull request #45 from g4b0/check-array-before-shifting

Bugfix: check array before shifting
This commit is contained in:
Michael Parkhill 2013-04-02 13:05:27 -07:00
commit 5eabb1b305

View File

@ -40,7 +40,7 @@ class WidgetAreaEditor extends FormField {
foreach($this->widgetClasses as $widgetClass) {
$classes = ClassInfo::subclassesFor($widgetClass);
array_shift($classes);
if(count($classes) > 1) array_shift($classes);
foreach($classes as $class) {
$widgets->push(singleton($class));
}