Skip to content
This repository has been archived by the owner on Sep 23, 2020. It is now read-only.

Error on Add User response #3

Closed
cfreman opened this issue May 24, 2014 · 2 comments
Closed

Error on Add User response #3

cfreman opened this issue May 24, 2014 · 2 comments

Comments

@cfreman
Copy link

cfreman commented May 24, 2014

Hi,

After much struggling I've finally managed to add an user to my ejabberd server. However, after adding it the module is crashing here:

TypeError: Cannot read property 'attrs' of undefined
    at Component.handler (/home/user/Projects/xmpptest/node_modules/node-xmpp-serviceadmin/lib/ServiceAdmin.js:55:53)
    at Component.EventEmitter.emit (events.js:117:20)
    at Component.onStanza (/home/user/Projects/xmpptest/node_modules/node-xmpp/node_modules/node-xmpp-component/index.js:62:10)
    at Connection.EventEmitter.emit (events.js:95:17)
    at Connection.onStanza (/home/user/Projects/xmpptest/node_modules/node-xmpp/node_modules/node-xmpp-core/lib/connection.js:330:14)
    at StreamParser.<anonymous> (/home/user/Projects/xmpptest/node_modules/node-xmpp/node_modules/node-xmpp-core/lib/connection.js:205:14)
    at StreamParser.EventEmitter.emit (events.js:95:17)
    at SaxExpat.<anonymous> (/home/user/Projects/xmpptest/node_modules/node-xmpp/node_modules/node-xmpp-core/lib/stream_parser.js:56:22)
    at SaxExpat.EventEmitter.emit (events.js:95:17)
    at null.<anonymous> (/home/user/Projects/xmpptest/node_modules/node-xmpp/node_modules/ltx/lib/sax/sax_expat.js:16:14)

The error is thrown in this line:

if (((_ref2 = (n = c.getChild("note")).attrs) != null ? _ref2.type : void 0) === "error") {

This is the content of c:

{ name: 'command',
  parent: 
   { name: 'iq',
     parent: null,
     attrs: 
      { from: 'domain.com',
        to: 'user@somewhere.com',
        id: 'exec1400964361322',
        type: 'result',
        'xmlns:stream': 'http://etherx.jabber.org/streams' },
     children: [ [Circular] ],
     nodeType: 1,
     nodeName: 'iq' },
  attrs: 
   { xmlns: 'http://jabber.org/protocol/commands',
     sessionid: '2014-05-24T20:46:12.453347Z',
     node: 'http://jabber.org/protocol/admin#add-user',
     status: 'completed' },
  children: [],
  nodeType: 1,
  nodeName: 'command' }

And the XML response from the server:

<iq from="domain.com" to="user@somewhere.com" id="exec1400964361322" type="result" xmlns:stream="http://etherx.jabber.org/streams"><command xmlns="http://jabber.org/protocol/commands" sessionid="2014-05-24T20:46:12.453347Z" node="http://jabber.org/protocol/admin#add-user" status="completed"/></iq>

Am I doing anything wrong?

Thanks!

@flosse
Copy link
Owner

flosse commented May 26, 2014

Hi @cfreman,
thank you for that report. I'll have a closer look at it within the next days.

@flosse
Copy link
Owner

flosse commented May 29, 2014

ok, this error was already fixed in v0.1.4, but this version was published with an outdated compiled JS file :-(
v0.1.5 should work now.

@flosse flosse closed this as completed May 29, 2014
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants