瀏覽代碼

ensure to return an empty array when passportService is null

Yuki Takei 7 年之前
父節點
當前提交
5c7ef64f66
共有 1 個文件被更改,包括 6 次插入0 次删除
  1. 6 0
      src/server/util/swigFunctions.js

+ 6 - 0
src/server/util/swigFunctions.js

@@ -141,6 +141,12 @@ module.exports = function(crowi, app, req, locals) {
   };
 
   locals.getSamlMissingMandatoryConfigKeys = function() {
+    // return an empty array if Passport is not enabled
+    // because crowi.passportService is null.
+    if (!locals.isEnabledPassport()) {
+      return [];
+    }
+
     return crowi.passportService.getSamlMissingMandatoryConfigKeys();
   };