mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
Trac #1556: Added if() check around a foreach loop that was causing errors when there were no entries in an RSS feed.
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@43890 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
parent
c186b13172
commit
07b0d18fa7
@ -129,8 +129,10 @@ class RSSFeed extends ViewableData {
|
||||
*/
|
||||
function Entries() {
|
||||
$output = new DataObjectSet();
|
||||
foreach($this->entries as $entry) {
|
||||
$output->push(new RSSFeed_Entry($entry, $this->titleField, $this->descriptionField, $this->authorField));
|
||||
if(isset($this->entries)) {
|
||||
foreach($this->entries as $entry) {
|
||||
$output->push(new RSSFeed_Entry($entry, $this->titleField, $this->descriptionField, $this->authorField));
|
||||
}
|
||||
}
|
||||
return $output;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user