mirror of
https://github.com/discourse/discourse.git
synced 2025-02-22 20:05:24 +08:00
BUGFIX: suppress error when scrolling at bottom of topic
fixes "Uncaught TypeError: Cannot call method 'get' of null" when scrolling at the bottom of the topic screen.
This commit is contained in:
parent
cfc1444177
commit
629e6f4158
@ -558,6 +558,8 @@ Discourse.TopicController = Discourse.ObjectController.extend(Discourse.Selected
|
|||||||
@params {Discourse.Post} post that is at the top
|
@params {Discourse.Post} post that is at the top
|
||||||
**/
|
**/
|
||||||
topVisibleChanged: function(post) {
|
topVisibleChanged: function(post) {
|
||||||
|
if (!post) { return; }
|
||||||
|
|
||||||
var postStream = this.get('postStream'),
|
var postStream = this.get('postStream'),
|
||||||
firstLoadedPost = postStream.get('firstLoadedPost');
|
firstLoadedPost = postStream.get('firstLoadedPost');
|
||||||
|
|
||||||
@ -589,6 +591,8 @@ Discourse.TopicController = Discourse.ObjectController.extend(Discourse.Selected
|
|||||||
@params {Discourse.Post} post that is at the bottom
|
@params {Discourse.Post} post that is at the bottom
|
||||||
**/
|
**/
|
||||||
bottomVisibleChanged: function(post) {
|
bottomVisibleChanged: function(post) {
|
||||||
|
if (!post) { return; }
|
||||||
|
|
||||||
var postStream = this.get('postStream'),
|
var postStream = this.get('postStream'),
|
||||||
lastLoadedPost = postStream.get('lastLoadedPost'),
|
lastLoadedPost = postStream.get('lastLoadedPost'),
|
||||||
index = postStream.get('stream').indexOf(post.get('id'))+1;
|
index = postStream.get('stream').indexOf(post.get('id'))+1;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user