Explorar o código

fix undefined error

Futa Arai %!s(int64=2) %!d(string=hai) anos
pai
achega
de8283f8df
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  1. 1 1
      apps/app/src/server/service/ldap.ts

+ 1 - 1
apps/app/src/server/service/ldap.ts

@@ -32,7 +32,7 @@ class LdapService {
 
     // parse serverUrl
     // see: https://regex101.com/r/0tuYBB/1
-    const match = serverUrl.match(/(ldaps?:\/\/[^/]+)\/(.*)?/);
+    const match = serverUrl?.match(/(ldaps?:\/\/[^/]+)\/(.*)?/);
     if (match == null || match.length < 1) {
       const urlInvalidMessage = 'serverUrl is invalid';
       logger.error(urlInvalidMessage);