Skip to content

Commit

Permalink
dom/element: catch errors coming up from Sizzle in #css
Browse files Browse the repository at this point in the history
  • Loading branch information
meh committed Jan 29, 2014
1 parent 721b1e9 commit 1372a58
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion opal/browser/dom/element.rb
Expand Up @@ -244,7 +244,11 @@ def css(path)
end
elsif Browser.loaded? 'Sizzle'
def css(path)
NodeSet.new(document, `Sizzle(#{path}, #@native)`)
begin
NodeSet.new(document, `Sizzle(path, #@native)`)
rescue
NodeSet.new(document)
end
end
else
def css(selector)
Expand Down

0 comments on commit 1372a58

Please sign in to comment.