浏览代码

Fix server stability issue

Gaël Métais 4 年之前
父节点
当前提交
405d53220b
共有 1 个文件被更改,包括 5 次插入3 次删除
  1. 5 3
      lib/tools/redownload/redownload.js

+ 5 - 3
lib/tools/redownload/redownload.js

@@ -758,11 +758,13 @@ var Redownload = function() {
             return request.isHTML && request.weightCheck && request.weightCheck.bodyBuffer;
         });
 
+        if (!htmlRequest) {
+            return false;
+        }
+
         debug('Checking if it is WordPress on file %s', htmlRequest.url);
 
-        if (htmlRequest && 
-            (htmlRequest.weightCheck.bodyBuffer.indexOf('/wp-content/') >= 0 ||
-            htmlRequest.weightCheck.bodyBuffer.indexOf('/wp-includes/') >= 0)) {
+        if (htmlRequest.weightCheck.bodyBuffer.indexOf('/wp-content/') >= 0 || htmlRequest.weightCheck.bodyBuffer.indexOf('/wp-includes/') >= 0) {
             debug('Response: yes.');
             return true;
         } else {