fix preview display of posts with 0 p tags
@@ -8,11 +8,12 @@ export class PostSnippet extends Component {
render() {
let elem = this.props.body.c.find((elem) => {
- return elem.gn === "p" &&
- typeof(elem.c[0]) === "string";
+ return (elem.gn === "p" && typeof(elem.c[0]) === "string");
});
- let string = elem.c[0];
+ let string = (elem === undefined)
+ ? null
+ : elem.c[0];
return (
<p className="body-regular-400 body-preview"
