Skip to content

Commit

Permalink
support optional siteConfig.users (#484)
Browse files Browse the repository at this point in the history
Fixes Issue #402 caused by removing optional users array from siteConfig file. Users array is now validated before using its properties.
  • Loading branch information
apiercebala authored and JoelMarcey committed Mar 7, 2018
1 parent a8d7299 commit 8c21455
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions examples/basics/pages/en/users.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ const siteConfig = require(process.cwd() + '/siteConfig.js');

class Users extends React.Component {
render() {
if ((siteConfig.users || []).length === 0) {
return null;
}
const showcase = siteConfig.users.map((user, i) => {
return (
<a href={user.infoLink} key={i}>
Expand Down

0 comments on commit 8c21455

Please sign in to comment.