<commit_before>/**
 * Created by mgab on 14/05/2017.
 */
import React,{ Component } from 'react'
import Title from './common/styled-components/Title'

import Lottery from './Lottery'


export default class Lotteries extends Component {

  render() {

    const lotteries = []

    this.props.lotteriesData.forEach((entry) => {
      lotteries.push(<Lottery name={entry.id}
                              jackpot={entry.jackpots[0].jackpot}
                              drawingDate={entry.drawingDate}
                              key={entry.id} />)
    })

    return (
      <div>
        <Title>Lotteries</Title>
        <div>
          {lotteries}
        </div>
      </div>
    )
  }
}<commit_msg>Check for lotteries data before trying to process them.<commit_after>/**
 * Created by mgab on 14/05/2017.
 */
import React,{ Component } from 'react'
import Title from './common/styled-components/Title'

import Lottery from './Lottery'


export default class Lotteries extends Component {

  render() {

    const lotteries = []

    if (this.props.lotteriesData) {
      this.props.lotteriesData.forEach((entry) => {
        lotteries.push(<Lottery name={entry.id}
                                jackpot={entry.jackpots[0].jackpot}
                                drawingDate={entry.drawingDate}
                                key={entry.id} />)
      })
    }


    return (
      <div>
        <Title>Lotteries</Title>
        <div>
          {lotteries}
        </div>
      </div>
    )
  }
}
{'fraction_non_alphanumeric': 0.1270791749833666, 'fraction_numerical': 0.011976047904191617, 'mean_word_length': 1.7495429616087752, 'pattern_counts': {'":': 0, '<': 17, '<?xml version=': 0, '>': 19, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4524947', 'n_tokens_mistral': 480, 'n_tokens_neox': 450, 'n_words': 92}