* fail as expected when using undefined {age}
This commit is contained in:
parent
6abb001249
commit
4ea21cd47f
|
@ -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")
|
||||
|
|
Loading…
Reference in New Issue