From a04f3f45fe4b03ede4f1f89b7610e50714e347b6 Mon Sep 17 00:00:00 2001 From: Jeremy Lainé Date: Fri, 12 Feb 2010 10:09:33 +0000 Subject: make it possible to attach an extension element to messages and presences --- source/QXmppElement.cpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'source/QXmppElement.cpp') 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)); -- cgit v1.2.3