# HG changeset patch # User Ingo Weinzierl # Date 1269597328 0 # Node ID 5fb1ea68e19c1d3d0e72fb2dba4d0f10fbaaba89 # Parent cd64ab8a46a76f61462e5f7354f8c117e93075ca Avoid danger to get a NullPointerException if no time to live is served by CallContext. gnv-artifacts/trunk@832 c6561f87-3c4e-4783-a992-168aeb5c3f6f diff -r cd64ab8a46a7 -r 5fb1ea68e19c gnv-artifacts/ChangeLog --- a/gnv-artifacts/ChangeLog Fri Mar 26 09:21:31 2010 +0000 +++ b/gnv-artifacts/ChangeLog Fri Mar 26 09:55:28 2010 +0000 @@ -1,3 +1,8 @@ +2010-03-26 Ingo Weinzierl + + * src/main/java/de/intevation/gnv/utils/MetaWriter.java: Avoid danger to get + a NullPointerException if no time to live is served by CallContext. + 2010-03-26 Ingo Weinzierl Issue197 diff -r cd64ab8a46a7 -r 5fb1ea68e19c gnv-artifacts/src/main/java/de/intevation/gnv/utils/MetaWriter.java --- a/gnv-artifacts/src/main/java/de/intevation/gnv/utils/MetaWriter.java Fri Mar 26 09:21:31 2010 +0000 +++ b/gnv-artifacts/src/main/java/de/intevation/gnv/utils/MetaWriter.java Fri Mar 26 09:55:28 2010 +0000 @@ -189,7 +189,7 @@ ArtifactNamespaceContext.NAMESPACE_PREFIX); Long time = callContext.getTimeToLive(); - time += new Date().getTime(); + time = time != null ? time + new Date().getTime() : null; String ttl = time != null ? time.toString() : null; logger.debug("Artifacts time to live: " + ttl); @@ -234,7 +234,7 @@ ArtifactNamespaceContext.NAMESPACE_PREFIX); Long time = context.getTimeToLive(); - time += new Date().getTime(); + time = time != null ? time + new Date().getTime() : null; String ttl = time != null ? time.toString() : null; logger.debug("Artifacts time to live: " + ttl); @@ -283,7 +283,7 @@ ArtifactNamespaceContext.NAMESPACE_PREFIX); Long time = context.getTimeToLive(); - time += new Date().getTime(); + time = time != null ? time + new Date().getTime() : null; String ttl = time != null ? time.toString() : null; logger.debug("Artifacts time to live: " + ttl);