Procházet zdrojové kódy

ensure to return an empty array when passportService is null

Yuki Takei před 7 roky
rodič
revize
5c7ef64f66
1 změnil soubory, kde provedl 6 přidání a 0 odebrání
  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();
   };