Don't assume that the model always exists on the binding when applying formatters to a value.
Showing
1 changed file
with
1 additions
and
1 deletions
... | @@ -42,7 +42,7 @@ class Rivets.Binding | ... | @@ -42,7 +42,7 @@ class Rivets.Binding |
42 | args = formatter.split /\s+/ | 42 | args = formatter.split /\s+/ |
43 | id = args.shift() | 43 | id = args.shift() |
44 | 44 | ||
45 | formatter = if @model[id] instanceof Function | 45 | formatter = if @model?[id] instanceof Function |
46 | @model[id] | 46 | @model[id] |
47 | else | 47 | else |
48 | @view.formatters[id] | 48 | @view.formatters[id] | ... | ... |
-
Please register or sign in to post a comment