diff --git a/app/components/markdown/markdown.js b/app/components/markdown/markdown.js index 4789d98f4..fcc4859d0 100644 --- a/app/components/markdown/markdown.js +++ b/app/components/markdown/markdown.js @@ -361,7 +361,7 @@ export default class Markdown extends PureComponent { if (this.props.isEdited) { const editIndicatorNode = new Node('edited_indicator'); - if (['heading', 'paragraph'].includes(ast.lastChild.type)) { + if (ast.lastChild && ['heading', 'paragraph'].includes(ast.lastChild.type)) { ast.lastChild.appendChild(editIndicatorNode); } else { const node = new Node('paragraph'); diff --git a/app/reducers/views/channel.js b/app/reducers/views/channel.js index a54c62ff4..e465c99cd 100644 --- a/app/reducers/views/channel.js +++ b/app/reducers/views/channel.js @@ -13,7 +13,7 @@ import {ViewTypes} from 'app/constants'; function displayName(state = '', action) { switch (action.type) { case ViewTypes.SET_CHANNEL_DISPLAY_NAME: - return action.displayName; + return action.displayName || ''; default: return state; }