@@ -219,7 +219,7 @@ const user = {
219219 commit ( 'SET_PROJECT' , { } )
220220 commit ( 'SET_HEADER_NOTICES' , [ ] )
221221 commit ( 'SET_FEATURES' , { } )
222- commit ( 'SET_LDAP' , { } )
222+ commit ( 'SET_LDAP' , false )
223223 commit ( 'SET_CLOUDIAN' , { } )
224224 commit ( 'SET_DOMAIN_STORE' , { } )
225225 commit ( 'SET_LOGOUT_FLAG' , false )
@@ -268,7 +268,7 @@ const user = {
268268 commit ( 'SET_PROJECT' , { } )
269269 commit ( 'SET_HEADER_NOTICES' , [ ] )
270270 commit ( 'SET_FEATURES' , { } )
271- commit ( 'SET_LDAP' , { } )
271+ commit ( 'SET_LDAP' , false )
272272 commit ( 'SET_CLOUDIAN' , { } )
273273 commit ( 'SET_DOMAIN_STORE' , { } )
274274 commit ( 'SET_LOGOUT_FLAG' , false )
@@ -420,9 +420,10 @@ const user = {
420420 } )
421421
422422 api ( 'listLdapConfigurations' ) . then ( response => {
423- const ldapEnable = ( response . ldapconfigurationresponse . count > 0 )
423+ const ldapEnable = ( ( response && response . ldapconfigurationresponse && response . ldapconfigurationresponse . count ) || 0 ) > 0
424424 commit ( 'SET_LDAP' , ldapEnable )
425425 } ) . catch ( ignored => {
426+ commit ( 'SET_LDAP' , false )
426427 } )
427428
428429 api ( 'cloudianIsEnabled' ) . then ( response => {
@@ -447,7 +448,7 @@ const user = {
447448 commit ( 'SET_PROJECT' , { } )
448449 commit ( 'SET_HEADER_NOTICES' , [ ] )
449450 commit ( 'SET_FEATURES' , { } )
450- commit ( 'SET_LDAP' , { } )
451+ commit ( 'SET_LDAP' , false )
451452 commit ( 'SET_CLOUDIAN' , { } )
452453 commit ( 'RESET_THEME' )
453454 commit ( 'SET_DOMAIN_STORE' , { } )
@@ -553,8 +554,9 @@ const user = {
553554 UpdateLdapConfigurationFlag ( { commit } ) {
554555 return new Promise ( ( resolve , reject ) => {
555556 api ( 'listLdapConfigurations' ) . then ( response => {
556- const ldapEnable = ( response . ldapconfigurationresponse . count > 0 )
557+ const ldapEnable = ( ( response && response . ldapconfigurationresponse && response . ldapconfigurationresponse . count ) || 0 ) > 0
557558 commit ( 'SET_LDAP' , ldapEnable )
559+ resolve ( ldapEnable )
558560 } ) . catch ( error => {
559561 reject ( error )
560562 } )
0 commit comments