Explorar o código

add getIsUploadable

zamis %!s(int64=5) %!d(string=hai) anos
pai
achega
1186c192b7
Modificáronse 1 ficheiros con 4 adicións e 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();