Skip to content
Snippets Groups Projects
Commit 87ef1de3 authored by Quoc Huy Nguyen Dinh's avatar Quoc Huy Nguyen Dinh
Browse files

Check type of variable before use

parent 21d49b2d
No related branches found
No related tags found
2 merge requests!343- gray out negative rshares comment and don't render the markdown,!342Check type of variable before use
import React from 'react';
import PropTypes from 'prop-types';
import { SRLWrapper } from "simple-react-lightbox";
import { Map } from 'immutable';
import { Link } from 'react-router';
import classnames from 'classnames';
import hljs from 'highlight.js/lib/common';
......@@ -54,7 +55,10 @@ function TimeAuthorCategory({ post }) {
function TimeAuthorCategoryLarge({ post }) {
const jsonMetadata = post.get('json_metadata');
const authoredBy = jsonMetadata.get('author');
let authoredBy;
if (jsonMetadata instanceof Map) {
authoredBy = jsonMetadata.get('author');
}
let author = post.get('author');
let created = post.get('created');
let updated = post.get('updated');
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment