mirror of
https://github.com/flarum/framework.git
synced 2024-11-23 13:30:47 +08:00
Prevent JS error if discussion has been loaded without posts
This commit is contained in:
parent
f2b500a6e5
commit
32beab9238
|
@ -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) => {
|
||||
|
|
Loading…
Reference in New Issue
Block a user