From 9945f47f40eb79b31dd7704ce24cbae871186025 Mon Sep 17 00:00:00 2001 From: Keith Donald Date: Tue, 1 Apr 2008 20:20:22 +0000 Subject: [PATCH] --- .../springframework/webflow/samples/booking/Booking.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/spring-webflow-samples/booking-faces/src/main/java/org/springframework/webflow/samples/booking/Booking.java b/spring-webflow-samples/booking-faces/src/main/java/org/springframework/webflow/samples/booking/Booking.java index 63dc61a4..69d5674b 100755 --- a/spring-webflow-samples/booking-faces/src/main/java/org/springframework/webflow/samples/booking/Booking.java +++ b/spring-webflow-samples/booking-faces/src/main/java/org/springframework/webflow/samples/booking/Booking.java @@ -68,7 +68,11 @@ public class Booking implements Serializable { @Transient public int getNights() { - return (int) (checkoutDate.getTime() - checkinDate.getTime()) / 1000 / 60 / 60 / 24; + if (checkinDate == null || checkoutDate == null) { + return 0; + } else { + return (int) (checkoutDate.getTime() - checkinDate.getTime()) / 1000 / 60 / 60 / 24; + } } @Id