diff options
Diffstat (limited to 'modules/aggregator/aggregator.module')
-rw-r--r-- | modules/aggregator/aggregator.module | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/modules/aggregator/aggregator.module b/modules/aggregator/aggregator.module index d320328ef..686f4248a 100644 --- a/modules/aggregator/aggregator.module +++ b/modules/aggregator/aggregator.module @@ -397,6 +397,7 @@ function aggregator_block_view($delta = '') { if (user_access('access news feeds')) { $block = array(); list($type, $id) = explode('-', $delta); + $result = FALSE; switch ($type) { case 'feed': if ($feed = db_query('SELECT fid, title, block FROM {aggregator_feed} WHERE block <> 0 AND fid = :fid', array(':fid' => $id))->fetchObject()) { @@ -414,9 +415,12 @@ function aggregator_block_view($delta = '') { } break; } + $items = array(); - foreach ($result as $item) { - $items[] = theme('aggregator_block_item', array('item' => $item)); + if (!empty($result)) { + foreach ($result as $item) { + $items[] = theme('aggregator_block_item', array('item' => $item)); + } } // Only display the block if there are items to show. |