Explorar el Código

add getIsUploadable

zamis hace 5 años
padre
commit
1186c192b7
Se han modificado 1 ficheros con 4 adiciones y 0 borrados
  1. 4 0
      src/server/service/file-uploader/aws.js

+ 4 - 0
src/server/service/file-uploader/aws.js

@@ -116,6 +116,10 @@ module.exports = function(crowi) {
   };
 
   lib.deleteFiles = async function(attachments) {
+    if (!this.getIsUploadable()) {
+      throw new Error('AWS is not configured.');
+    }
+
     const s3 = S3Factory();
     const awsConfig = getAwsConfig();