<commit_before>import React, { Component } from 'react';
import classnames from 'classnames';

export class PostSnippet extends Component {
  constructor(props) {
    super(props);
  }

  render() {
    let elem = this.props.body.c.find((elem) => {
      return elem.gn === "p" &&
        typeof(elem.c[0]) === "string";
    });

    let string = elem.c[0];

    return (
      <p className="body-regular-400 body-preview"
        style={{WebkitBoxOrient: "vertical"}}>
        {string}
      </p>
    );
  }
}

<commit_msg>fix preview display of posts with 0 p tags<commit_after>import React, { Component } from 'react';
import classnames from 'classnames';

export class PostSnippet extends Component {
  constructor(props) {
    super(props);
  }

  render() {
    let elem = this.props.body.c.find((elem) => {
      return (elem.gn === "p" && typeof(elem.c[0]) === "string");
    });

    let string = (elem === undefined)
      ?  null
      :  elem.c[0];

    return (
      <p className="body-regular-400 body-preview"
        style={{WebkitBoxOrient: "vertical"}}>
        {string}
      </p>
    );
  }
}


{'fraction_non_alphanumeric': 0.16412556053811658, 'fraction_numerical': 0.009865470852017937, 'mean_word_length': 2.6116504854368934, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 9, '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': '4036932', 'n_tokens_mistral': 371, 'n_tokens_neox': 362, 'n_words': 83}