1
0
mirror of https://github.com/flarum/core.git synced 2025-08-06 08:27:42 +02:00

Fix crash when displaying a discussion with no posts. closes #823

This commit is contained in:
Toby Zerner
2016-02-22 22:22:49 +10:30
parent 71d2e71908
commit 05fe4446bf
4 changed files with 13 additions and 7 deletions

View File

@@ -184,7 +184,7 @@ export default class DiscussionPage extends Page {
// the specific post that was routed to.
this.stream = new PostStream({discussion, includedPosts});
this.stream.on('positionChanged', this.positionChanged.bind(this));
this.stream.goToNumber(m.route.param('near') || includedPosts[0].number(), true);
this.stream.goToNumber(m.route.param('near') || (includedPosts[0] && includedPosts[0].number()), true);
}
/**