Prevent JS error if discussion has been loaded without posts

This commit is contained in:
Toby Zerner 2015-06-18 17:42:08 +09:30
parent f2b500a6e5
commit 32beab9238

View File

@ -6,7 +6,8 @@ class Discussion extends Model {
pushData(newData) {
super.pushData(newData);
var posts = this.data().links.posts;
var links = this.data().links;
var posts = links && links.posts;
if (posts) {
if (newData.removedPosts) {
posts.linkage.forEach((linkage, i) => {