Sfoglia il codice sorgente

add getIsUploadable

zamis 5 anni fa
parent
commit
1186c192b7
1 ha cambiato i file con 4 aggiunte e 0 eliminazioni
  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) {
   lib.deleteFiles = async function(attachments) {
+    if (!this.getIsUploadable()) {
+      throw new Error('AWS is not configured.');
+    }
+
     const s3 = S3Factory();
     const s3 = S3Factory();
     const awsConfig = getAwsConfig();
     const awsConfig = getAwsConfig();