Description
Issue probably difficult to reproduce without a specific setup but it seem that when we have in the LDAP settings xwiki.authentication.ldap.follow_referrals=0 and we call XWikiLDAPConnection#searchLDAP we can end on a NPE with this following log before the exception:
2026-07-29 15:21:15,210 [http-nio-8080-exec-340 - https://domain.tld/xwiki/bin/view/XXX/LiveTableResults] DEBUG o.x.c.l.PagedLDAPSearchResults - Failed to call next value because it require a referral but referral following is disabled
com.novell.ldap.LDAPReferralException: Referral
at com.novell.ldap.LDAPSearchResults.next(LDAPSearchResults.java:253)
at org.xwiki.contrib.ldap.PagedLDAPSearchResults.next(PagedLDAPSearchResults.java:185)
at org.xwiki.contrib.ldap.XWikiLDAPConnection.searchLDAP(XWikiLDAPConnection.java:531)
at org.xwiki.contrib.ldap.XWikiLDAPUtils.searchUserAttributesByUid(XWikiLDAPUtils.java:1222)
...