Fixed #22
This commit is contained in:
@@ -26,7 +26,21 @@ const NewsFeed = props => {
|
|||||||
return (
|
return (
|
||||||
<div>
|
<div>
|
||||||
<h1 className='centered'>News Feed</h1>
|
<h1 className='centered'>News Feed</h1>
|
||||||
{articles.map((article, index) => {
|
{(articles || []).map((article, index) => {
|
||||||
|
//BUGFIX: check for empty data
|
||||||
|
if (!article.title) {
|
||||||
|
return article.title = '';
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!article.author) {
|
||||||
|
return article.author = '';
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!article.body) {
|
||||||
|
return article.body = '';
|
||||||
|
}
|
||||||
|
|
||||||
|
//render
|
||||||
return (
|
return (
|
||||||
<div key={index}>
|
<div key={index}>
|
||||||
<hr />
|
<hr />
|
||||||
|
|||||||
Reference in New Issue
Block a user