diff options
author | Artur Signell <artur@vaadin.com> | 2015-08-04 00:16:04 +0300 |
---|---|---|
committer | Vaadin Code Review <review@vaadin.com> | 2015-08-04 12:18:04 +0000 |
commit | f3ae913aa05fedd33c5b706f75cf6c37310a3f84 (patch) | |
tree | 33f8f80810a5f1426d4fe4aefd76feb7febd69cd /client/src | |
parent | ae9adec0467ea88fd12e0295791b77f5ef3010ae (diff) | |
download | vaadin-framework-f3ae913aa05fedd33c5b706f75cf6c37310a3f84.tar.gz vaadin-framework-f3ae913aa05fedd33c5b706f75cf6c37310a3f84.zip |
Fix NPE when clicking and move handler is not set (#8718)
Change-Id: I13dfe9344d7ca516d41145e4c35fc45c620cac56
Diffstat (limited to 'client/src')
-rw-r--r-- | client/src/com/vaadin/client/ui/calendar/schedule/DateCellDayEvent.java | 9 | ||||
-rw-r--r-- | client/src/com/vaadin/client/ui/calendar/schedule/SimpleDayCell.java | 7 |
2 files changed, 12 insertions, 4 deletions
diff --git a/client/src/com/vaadin/client/ui/calendar/schedule/DateCellDayEvent.java b/client/src/com/vaadin/client/ui/calendar/schedule/DateCellDayEvent.java index 1a54fe0454..55834397d3 100644 --- a/client/src/com/vaadin/client/ui/calendar/schedule/DateCellDayEvent.java +++ b/client/src/com/vaadin/client/ui/calendar/schedule/DateCellDayEvent.java @@ -268,8 +268,13 @@ public class DateCellDayEvent extends FocusableHTML implements } int endX = event.getClientX(); int endY = event.getClientY(); - int xDiff = startX - endX; - int yDiff = startY - endY; + int xDiff = 0, yDiff = 0; + if (startX != -1 && startY != -1) { + // Drag started + xDiff = startX - endX; + yDiff = startY - endY; + } + startX = -1; startY = -1; mouseMoveStarted = false; diff --git a/client/src/com/vaadin/client/ui/calendar/schedule/SimpleDayCell.java b/client/src/com/vaadin/client/ui/calendar/schedule/SimpleDayCell.java index 3bf6930933..158241337b 100644 --- a/client/src/com/vaadin/client/ui/calendar/schedule/SimpleDayCell.java +++ b/client/src/com/vaadin/client/ui/calendar/schedule/SimpleDayCell.java @@ -392,8 +392,11 @@ public class SimpleDayCell extends FocusableFlowPanel implements int endX = event.getClientX(); int endY = event.getClientY(); - int xDiff = startX - endX; - int yDiff = startY - endY; + int xDiff = 0, yDiff = 0; + if (startX != -1 && startY != -1) { + xDiff = startX - endX; + yDiff = startY - endY; + } startX = -1; startY = -1; prevDayDiff = 0; |