Skip to content

Commit

Permalink
Fixed error not catched
Browse files Browse the repository at this point in the history
  • Loading branch information
johanbrook committed May 30, 2012
1 parent 12a9572 commit 404c7d6
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion build/public/javascripts/client.js
Expand Up @@ -39,7 +39,7 @@

showClosestStore = function(json) {
var closes, data, is_open, obj, opens;
if (!json) return error("No data was received");
if (!json || json.length === 0) return error("No data was received");
obj = json[0];
opens = new Date(Date.parse(obj.opening_hours.opens));
closes = new Date(Date.parse(obj.opening_hours.closes));
Expand Down
2 changes: 1 addition & 1 deletion src/public/javascripts/client.coffee
Expand Up @@ -28,7 +28,7 @@ handler = (position) ->


showClosestStore = (json) ->
return error "No data was received" if not json
return error "No data was received" if not json or json.length is 0
obj = json[0]

opens = new Date(Date.parse obj.opening_hours.opens)
Expand Down

0 comments on commit 404c7d6

Please sign in to comment.