In View.build, protect nodes from being parsed that have no attributes.
This can happen when you've loaded a text file from the server, passed it to jquery, and the resulting list of nodes contains text nodes(the trailing newline, for instance).
Showing
1 changed file
with
1 additions
and
1 deletions
... | @@ -262,7 +262,7 @@ class Rivets.View | ... | @@ -262,7 +262,7 @@ class Rivets.View |
262 | return | 262 | return |
263 | 263 | ||
264 | for el in @els | 264 | for el in @els |
265 | parse el | 265 | parse el if el.attributes? |
266 | parse node for node in el.getElementsByTagName '*' when node.attributes? | 266 | parse node for node in el.getElementsByTagName '*' when node.attributes? |
267 | 267 | ||
268 | return | 268 | return | ... | ... |
-
Please register or sign in to post a comment