Fixes a bug when the endDate in a period request is null.

Signed-off-by: Michel Verbraak <info@1st-setup.nl>