Skip to content

Commit 6352b46

Browse files
authored
Fixed exception when collection selects non-existent attribute in PR #2993 (#3038)
1 parent 0f104a7 commit 6352b46

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

app/code/core/Mage/Eav/Model/Entity/Collection/Abstract.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -438,6 +438,10 @@ public function addAttributeToSelect($attribute, $joinType = false)
438438
} else {
439439
$attrInstance = Mage::getSingleton('eav/config')
440440
->getAttribute($this->getEntity()->getType(), $attribute);
441+
// failure to resolve an attribute from the eav config implies it does not exist
442+
if (empty($attrInstance)) {
443+
return $this;
444+
}
441445
}
442446
if (empty($attrInstance)) {
443447
throw Mage::exception(

0 commit comments

Comments
 (0)