Fix render for empty message updates

This commit is contained in:
Chris Blanchard 2015-10-01 14:28:58 +01:00
parent 4cc80c48a6
commit 5f4fbabbc1

View file

@ -23,11 +23,13 @@ var Chatroom = React.createClass({
},
render() {
let messages = this.props.messages.map(message =>
<ChatMessage message={message}
let messages = this.props.messages.map(message => {
if (message) {
return <ChatMessage message={message}
key={message.id}
user={this.props.user} />
);
}
});
return (
<div className="panel panel-primary chatbox">
<div className="panel-heading">Gather Chat</div>