<commit_before>import React  from 'react'
import marked from 'marked'

import Loading                  from './Loading'
import http                     from '../http'
import {urlify}                 from '../util'
import {setContent, setEditing} from '../megablob/actions'

export default React.createClass({

  getInitialState () {
    return {
      content: this.props.content
    }
  },

  componentDidMount () {
    if (!this.props.content) {
      const path = urlify(this.props.title)
      http.get(`/api${path}`)
        .then(content => setContent({path, content}))
        .catch(error  => console.log(error))
    }
  },

  componentWillUnmount () {<commit_msg>Fix bug with empty content<commit_after>import React  from 'react'
import marked from 'marked'

import Loading                  from './Loading'
import http                     from '../http'
import {urlify}                 from '../util'
import {setContent, setEditing} from '../megablob/actions'

export default React.createClass({

  getInitialState () {
    return {
      content: this.props.content
    }
  },

  componentDidMount () {
    if (this.props.content === undefined) {
      const path = urlify(this.props.title)
      http.get(`/api${path}`)
        .then(content => setContent({path, content}))
        .catch(error  => console.log(error))
    }
  },

  componentWillUnmount () {
{'fraction_non_alphanumeric': 0.13576642335766423, 'fraction_numerical': 0.0, 'mean_word_length': 2.3196125907990313, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, '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': '940619', 'n_tokens_mistral': 401, 'n_tokens_neox': 384, 'n_words': 95}