From 4e43a590c47bacd29e36c49eb6393085c0e82715 Mon Sep 17 00:00:00 2001 From: Jelte Fennema Date: Fri, 16 Jan 2015 18:27:11 +0100 Subject: [PATCH] Fix hover error when hovering over an empty bar chart --- lib/morris.bar.coffee | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/morris.bar.coffee b/lib/morris.bar.coffee index 521fd13..b6a34ea 100644 --- a/lib/morris.bar.coffee +++ b/lib/morris.bar.coffee @@ -238,7 +238,10 @@ class Morris.Bar extends Morris.Grid # @private onHoverMove: (x, y) => index = @hitTest(x, y) - @hover.update(@hoverContentForRow(index)...) + if index? + @hover.update(@hoverContentForRow(index)...) + else + @hover.hide() # hover out event handler #