mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
FIX: If there are no featured topics in a category, don't fail.
This commit is contained in:
@@ -111,7 +111,10 @@ Discourse.Category = Discourse.Model.extend({
|
||||
}.property(),
|
||||
|
||||
latestTopic: function(){
|
||||
return this.get("topics")[0];
|
||||
var topics = this.get('topics');
|
||||
if (topics && topics.length) {
|
||||
return topics[0]
|
||||
}
|
||||
}.property("topics"),
|
||||
|
||||
topicTrackingState: function(){
|
||||
|
||||
Reference in New Issue
Block a user