Skip to content

Commit

Permalink
Check column arg is a string in AppView.addOne()
Browse files Browse the repository at this point in the history
  • Loading branch information
Malcolm Locke committed Sep 22, 2011
1 parent 0d87808 commit 43b8c4c
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion public/javascripts/views/app_view.js
Expand Up @@ -11,7 +11,11 @@ var AppView = Backbone.View.extend({
},

addOne: function(story, column) {
if (typeof column === 'undefined') {
// If column is blank determine it from the story. When the add event
// is bound on a collection, the callback send the collection as the
// second argument, so also check that column is a string and not an
// object for those cases.
if (typeof column === 'undefined' || typeof column !== 'string') {
column = story.column();
}
var view = new StoryView({model: story});
Expand Down

0 comments on commit 43b8c4c

Please sign in to comment.