Преглед на файлове

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();
   };