ソースを参照

Merge pull request #792 from weseek/fix/790-npe-in-admin-security

ensure to return an empty array when passportService is null
Yuki Takei 7 年 前
コミット
3464555640
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();
   };