Skip to content

Commit

Permalink
Handle empty JSON
Browse files Browse the repository at this point in the history
  • Loading branch information
trobrock committed Apr 11, 2014
1 parent 923f727 commit ea0e588
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
6 changes: 5 additions & 1 deletion lib/slate/calculation.rb
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,11 @@ def target(name, value)
end

def data
@data ||= JSON.parse(@graph.download(:json))
@data ||= begin
JSON.parse(@graph.download(:json))
rescue JSON::ParserError
[]
end
end
end
end
Expand Down
2 changes: 1 addition & 1 deletion lib/slate/version.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module Slate
VERSION = "1.1.1"
VERSION = "1.1.2"
end

0 comments on commit ea0e588

Please sign in to comment.