From 509f59c32d5fab33bf2ef21602fd1540d7a90a7a Mon Sep 17 00:00:00 2001 From: Jan Bartel Date: Fri, 14 Apr 2017 14:43:41 +1000 Subject: [PATCH] Issue #1472 --- .../java/org/eclipse/jetty/server/ResourceContentFactory.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/jetty-server/src/main/java/org/eclipse/jetty/server/ResourceContentFactory.java b/jetty-server/src/main/java/org/eclipse/jetty/server/ResourceContentFactory.java index df8706dd132..2c5b0f8d6cb 100644 --- a/jetty-server/src/main/java/org/eclipse/jetty/server/ResourceContentFactory.java +++ b/jetty-server/src/main/java/org/eclipse/jetty/server/ResourceContentFactory.java @@ -82,7 +82,7 @@ public class ResourceContentFactory implements ContentFactory { String compressedPathInContext = pathInContext + format._extension; Resource compressedResource = _factory.getResource(compressedPathInContext); - if (compressedResource.exists() && compressedResource.lastModified() >= resource.lastModified() + if (compressedResource != null && compressedResource.exists() && compressedResource.lastModified() >= resource.lastModified() && compressedResource.length() < resource.length()) compressedContents.put(format, new ResourceHttpContent(compressedResource,_mimeTypes.getMimeByExtension(compressedPathInContext),maxBufferSize));