Merge pull request #707 from ldidry/fix-706

Fix #706 Correct null ComponentGroup check for Atom and RSS feeds
This commit is contained in:
James Brooks 2015-06-12 08:52:31 +01:00
commit 884c43f160
2 changed files with 2 additions and 2 deletions

View File

@ -34,7 +34,7 @@ class AtomController extends AbstractController
$feed->setDateFormat('datetime');
if ($group) {
if ($group->exists) {
$group->components->map(function ($component) use ($feed) {
$component->incidents()->orderBy('created_at', 'desc')->get()->map(function ($incident) use ($feed) {
$this->feedAddItem($feed, $incident);

View File

@ -34,7 +34,7 @@ class RssController extends AbstractController
$feed->setDateFormat('datetime');
if ($group) {
if ($group->exists) {
$group->components->map(function ($component) use ($feed) {
$component->incidents()->orderBy('created_at', 'desc')->get()->map(function ($incident) use ($feed) {
$this->feedAddItem($feed, $incident);