itizawa 5 лет назад
Родитель
Сommit
75cf9abb9d
1 измененных файлов с 5 добавлено и 2 удалено
  1. 5 2
      src/server/service/file-uploader/gcs.js

+ 5 - 2
src/server/service/file-uploader/gcs.js

@@ -56,8 +56,11 @@ module.exports = function(crowi) {
   };
 
   lib.respond = async function(res, attachment) {
-    // TODO refacotr this code after GW-4630
-    const gcs = getGcsInstance(this.getIsUploadable());
+    if (!this.getIsUploadable()) {
+      throw new Error('GCS is not configured.');
+    }
+
+    const gcs = getGcsInstance();
     const myBucket = gcs.bucket(getGcsBucket());
     const filePath = getFilePathOnStorage(attachment);
     const file = myBucket.file(filePath);