mirror of
https://github.com/flarum/framework.git
synced 2025-05-22 22:59:57 +08:00
Prevent JS error if discussion has been loaded without posts
This commit is contained in:
@ -6,7 +6,8 @@ class Discussion extends Model {
|
|||||||
pushData(newData) {
|
pushData(newData) {
|
||||||
super.pushData(newData);
|
super.pushData(newData);
|
||||||
|
|
||||||
var posts = this.data().links.posts;
|
var links = this.data().links;
|
||||||
|
var posts = links && links.posts;
|
||||||
if (posts) {
|
if (posts) {
|
||||||
if (newData.removedPosts) {
|
if (newData.removedPosts) {
|
||||||
posts.linkage.forEach((linkage, i) => {
|
posts.linkage.forEach((linkage, i) => {
|
||||||
|
Reference in New Issue
Block a user