From 96ee77d85b9e0880c7986894de16c546f114b3d2 Mon Sep 17 00:00:00 2001 From: Chad Weider Date: Tue, 28 Feb 2012 18:05:27 -0800 Subject: [PATCH] Check error not stats. --- node/utils/caching_middleware.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/node/utils/caching_middleware.js b/node/utils/caching_middleware.js index 809bb210..2cdb2dfc 100644 --- a/node/utils/caching_middleware.js +++ b/node/utils/caching_middleware.js @@ -53,7 +53,7 @@ CachingMiddleware.prototype = new function () { fs.stat(CACHE_DIR + 'minified_' + cacheKey, function (error, stats) { var modifiedSince = (req.headers['if-modified-since'] && new Date(req.headers['if-modified-since'])); - var lastModifiedCache = stats && stats.mtime; + var lastModifiedCache = !error && stats.mtime; if (lastModifiedCache) { req.headers['if-modified-since'] = lastModifiedCache.toUTCString(); } else {