This commit is contained in:
Keith Donald
2008-04-01 20:20:22 +00:00
parent ad7a5b314e
commit 9945f47f40

View File

@@ -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