NPE when attempting to create a session with no JID resource

Description

Imported issue was from daniel:
While this is "not really allowed", I shouldn't let a NPE occur, should at least catch and toss.

Environment

None

Activity

Show:
daniel vultur
November 20, 2008, 4:14 PM

I can't exactly see where this is occuring. It's not a "big problem" though. Only component developers will ever see it.

daniel vultur
November 20, 2008, 4:14 PM

in TransportSession.java in the constructor that includes priority.

public TransportSession(Registration registration, JID jid, BaseTransport transport, Integer priority) { this.jid = new JID(jid.toBareJID()); this.registration = registration; this.transport = transport; addResource(jid.getResource(), priority); Log.debug("Created "transport.getType()" session for "jid" as '"registration.getUsername()"'"); }

If a JID has no resource it'll throw a null pointer exception in addResource method.

Assignee

Daniel Henninger

Reporter

Daniel Henninger