We're updating the issue view to help you get more done. 

Fix NPE in LdapVCardProvider when username was not found

Description

Trying to load a vCard of a user that does not exist will generate the following NPE.

2006.11.01 16:59:03 [org.jivesoftware.wildfire.ldap.LdapVCardProvider.getLdapAttributes(LdapVCardProvider.java:158)
]
org.jivesoftware.wildfire.user.UserNotFoundException: Username admin not found
at org.jivesoftware.wildfire.ldap.LdapManager.findUserDN(LdapManager.java:613)
at org.jivesoftware.wildfire.ldap.LdapManager.findUserDN(LdapManager.java:541)
at org.jivesoftware.wildfire.ldap.LdapVCardProvider.getLdapAttributes(LdapVCardProvider.java:137)
at org.jivesoftware.wildfire.ldap.LdapVCardProvider.loadVCard(LdapVCardProvider.java:176)
at org.jivesoftware.wildfire.vcard.VCardManager.getOrLoadVCard(VCardManager.java:198)
at org.jivesoftware.wildfire.vcard.VCardManager.getVCard(VCardManager.java:191)
at org.jivesoftware.wildfire.handler.IQvCardHandler.handleIQ(IQvCardHandler.java:107)
at org.jivesoftware.wildfire.handler.IQHandler.process(IQHandler.java:48)
at org.jivesoftware.wildfire.IQRouter.handle(IQRouter.java:268)
at org.jivesoftware.wildfire.IQRouter.route(IQRouter.java:96)
at org.jivesoftware.wildfire.spi.PacketRouterImpl.route(PacketRouterImpl.java:67)
at org.jivesoftware.wildfire.net.SocketReader.processIQ(SocketReader.java:250)
at org.jivesoftware.wildfire.net.ClientSocketReader.processIQ(ClientSocketReader.java:51)
at org.jivesoftware.wildfire.net.SocketReader.process(SocketReader.java:216)
at org.jivesoftware.wildfire.net.BlockingReadingMode.readStream(BlockingReadingMode.java:156)
at org.jivesoftware.wildfire.net.BlockingReadingMode.run(BlockingReadingMode.java:62)
at org.jivesoftware.wildfire.net.SocketReader.run(SocketReader.java:123)
at java.lang.Thread.run(Thread.java:595)

2006.11.01 16:59:03 [org.jivesoftware.wildfire.handler.IQHandler.process(IQHandler.java:68)
] Internal server error
java.lang.NullPointerException
at org.jivesoftware.wildfire.ldap.LdapVCardProvider$VCard.treeWalk(LdapVCardProvider.java:300)
at org.jivesoftware.wildfire.ldap.LdapVCardProvider$VCard.treeWalk(LdapVCardProvider.java:305)
at org.jivesoftware.wildfire.ldap.LdapVCardProvider$VCard.getVCard(LdapVCardProvider.java:282)
at org.jivesoftware.wildfire.ldap.LdapVCardProvider.loadVCard(LdapVCardProvider.java:178)
at org.jivesoftware.wildfire.vcard.VCardManager.getOrLoadVCard(VCardManager.java:198)
at org.jivesoftware.wildfire.vcard.VCardManager.getVCard(VCardManager.java:191)
at org.jivesoftware.wildfire.handler.IQvCardHandler.handleIQ(IQvCardHandler.java:107)
at org.jivesoftware.wildfire.handler.IQHandler.process(IQHandler.java:48)
at org.jivesoftware.wildfire.IQRouter.handle(IQRouter.java:268)
at org.jivesoftware.wildfire.IQRouter.route(IQRouter.java:96)
at org.jivesoftware.wildfire.spi.PacketRouterImpl.route(PacketRouterImpl.java:67)
at org.jivesoftware.wildfire.net.SocketReader.processIQ(SocketReader.java:250)
at org.jivesoftware.wildfire.net.ClientSocketReader.processIQ(ClientSocketReader.java:51)
at org.jivesoftware.wildfire.net.SocketReader.process(SocketReader.java:216)
at org.jivesoftware.wildfire.net.BlockingReadingMode.readStream(BlockingReadingMode.java:156)
at org.jivesoftware.wildfire.net.BlockingReadingMode.run(BlockingReadingMode.java:62)
at org.jivesoftware.wildfire.net.SocketReader.run(SocketReader.java:123)
at java.lang.Thread.run(Thread.java:595)

Environment

None

Acceptance Test - Entry

None

Assignee

Gaston Dombiak

Reporter

Gaston Dombiak

Labels

None

Expected Effort

None

Ignite Forum URL

None

Components

Fix versions

Affects versions

Priority

Minor
Configure