mirror of
https://github.com/codeninjasllc/discourse.git
synced 2024-11-28 10:08:20 -05:00
FIX: If there are no featured topics in a category, don't fail.
This commit is contained in:
parent
7bbb32bac2
commit
bdac13b636
1 changed files with 4 additions and 1 deletions
|
@ -111,7 +111,10 @@ Discourse.Category = Discourse.Model.extend({
|
||||||
}.property(),
|
}.property(),
|
||||||
|
|
||||||
latestTopic: function(){
|
latestTopic: function(){
|
||||||
return this.get("topics")[0];
|
var topics = this.get('topics');
|
||||||
|
if (topics && topics.length) {
|
||||||
|
return topics[0]
|
||||||
|
}
|
||||||
}.property("topics"),
|
}.property("topics"),
|
||||||
|
|
||||||
topicTrackingState: function(){
|
topicTrackingState: function(){
|
||||||
|
|
Loading…
Reference in a new issue