Don't throw error if broadcastArray is undefined
This commit is contained in:
parent
ab0b0cbebc
commit
c40e413f35
|
@ -33,7 +33,7 @@ export default DS.RESTAdapter.extend({
|
|||
// be to create my own URL generator
|
||||
_buildURL: function(modelName, id) {
|
||||
var url = [];
|
||||
var host = get(this, 'host');
|
||||
var host = Ember.get(this, 'host');
|
||||
var prefix = this.urlPrefix();
|
||||
var path;
|
||||
|
||||
|
|
|
@ -18,6 +18,8 @@ Controller = Ember.Controller.extend
|
|||
).property('user.gravatarId')
|
||||
|
||||
defineTowerColor: (broadcastArray) ->
|
||||
return '' unless broadcastArray
|
||||
|
||||
if broadcastArray.length
|
||||
if broadcastArray.findBy('category', 'warning')
|
||||
return 'warning'
|
||||
|
@ -75,7 +77,7 @@ Controller = Ember.Controller.extend
|
|||
id = broadcast.get('id').toString()
|
||||
seenBroadcasts = @get('storage').getItem('travis.seen_broadcasts')
|
||||
if seenBroadcasts
|
||||
seenBroadcasts = JSON.parse(seenBroadcasts)
|
||||
seenBroadcasts = JSON.parse(seenBroadcasts)
|
||||
else
|
||||
seenBroadcasts = []
|
||||
seenBroadcasts.push(id)
|
||||
|
|
Loading…
Reference in New Issue
Block a user