From 4ea21cd47f6a1f02b79673db88301065d174d131 Mon Sep 17 00:00:00 2001 From: Reinhard Pointner Date: Sat, 25 Oct 2014 09:44:33 +0000 Subject: [PATCH] * fail as expected when using undefined {age} --- source/net/filebot/format/MediaBindingBean.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/source/net/filebot/format/MediaBindingBean.java b/source/net/filebot/format/MediaBindingBean.java index 78753417..38db3187 100644 --- a/source/net/filebot/format/MediaBindingBean.java +++ b/source/net/filebot/format/MediaBindingBean.java @@ -181,7 +181,11 @@ public class MediaBindingBean { @Define("age") public Number getAgeInDays() { - return TimeUnit.MILLISECONDS.toDays(System.currentTimeMillis() - getReleaseDate().getTimeStamp()); + SimpleDate releaseDate = getReleaseDate(); + if (releaseDate != null) { + return TimeUnit.MILLISECONDS.toDays(System.currentTimeMillis() - releaseDate.getTimeStamp()); + } + return null; } @Define("startdate")