diff options
| author | Jeremy Lainé <jeremy.laine@m4x.org> | 2010-02-12 10:09:33 +0000 |
|---|---|---|
| committer | Jeremy Lainé <jeremy.laine@m4x.org> | 2010-02-12 10:09:33 +0000 |
| commit | a04f3f45fe4b03ede4f1f89b7610e50714e347b6 (patch) | |
| tree | 2a5fdd095a40da6a359427c031cabcb38dfdc966 /source/QXmppElement.cpp | |
| parent | 4382a8afdb899e59ea8bff5caec7d70d4c64bcc6 (diff) | |
| download | qxmpp-a04f3f45fe4b03ede4f1f89b7610e50714e347b6.tar.gz | |
make it possible to attach an extension element to messages and presences
Diffstat (limited to 'source/QXmppElement.cpp')
| -rw-r--r-- | source/QXmppElement.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/source/QXmppElement.cpp b/source/QXmppElement.cpp index a793a999..2dcb87ad 100644 --- a/source/QXmppElement.cpp +++ b/source/QXmppElement.cpp @@ -32,6 +32,9 @@ QXmppElement::QXmppElement() QXmppElement::QXmppElement(const QDomElement &element) { + if (element.isNull()) + return; + m_tagName = element.tagName(); QString xmlns = element.namespaceURI(); QString parentns = element.parentNode().namespaceURI(); @@ -94,6 +97,9 @@ void QXmppElement::setTagName(const QString &tagName) void QXmppElement::toXml(QXmlStreamWriter *writer) const { + if (isNull()) + return; + writer->writeStartElement(m_tagName); foreach (const QString &attr, m_attributes.keys()) helperToXmlAddAttribute(writer, attr, m_attributes.value(attr)); |
