Do not write an empty preload manifest
authorTim Düsterhus <duesterhus@woltlab.com>
Mon, 8 Mar 2021 14:57:08 +0000 (15:57 +0100)
committerTim Düsterhus <duesterhus@woltlab.com>
Mon, 8 Mar 2021 15:26:29 +0000 (16:26 +0100)
see d2779a57533b315ce08c3436d9753f16ee1fdbfe

wcfsetup/install/files/lib/system/style/StyleCompiler.class.php

index 4684685a805c58c3f47b29facc98c49079ace17a..d73fa78c579bd9b50ff12b3edd2e228d43c0bc7e 100644 (file)
@@ -657,8 +657,10 @@ EOT;
         \file_put_contents($filePrefix . '-rtl.css', $this->convertToRtl($css));
         FileUtil::makeWritable($filePrefix . '-rtl.css');
 
-        \file_put_contents($filePrefix . '-preload.json', JSON::encode($preloadManifest));
-        FileUtil::makeWritable($filePrefix . '-preload.json');
+        if ($preloadManifest) {
+            \file_put_contents($filePrefix . '-preload.json', JSON::encode($preloadManifest));
+            FileUtil::makeWritable($filePrefix . '-preload.json');
+        }
     }
 
     /**