return {} for empty response from CouchDB view
authorDobrica Pavlinusic <dpavlin@rot13.org>
Mon, 17 Oct 2011 20:15:02 +0000 (22:15 +0200)
committerDobrica Pavlinusic <dpavlin@rot13.org>
Mon, 17 Oct 2011 20:15:02 +0000 (22:15 +0200)
angular-server.pl

index 1ef3778..d2edf1d 100755 (executable)
@@ -308,6 +308,8 @@ get '/reservations/events/:view_name' => sub {
                $hash->{ $row->{key} } = $row->{value};
        }
 
                $hash->{ $row->{key} } = $row->{value};
        }
 
+       $hash ||= {};
+
        _render_jsonp( $self, $hash );
 };
 
        _render_jsonp( $self, $hash );
 };