Subject: NullReferenceExcpetion on IqFilter.SendIq (.net 3.5 client profile)
I have the following method:
private void RequestVcardAsync(Jid to)
{
if (m_JidPhotoMapping.ContainsKey(to.Bare))
{
return;
}
var vcard = new VcardIq(to)
{
Type = Matrix.Xmpp.IqType.get
};
if (vcard.Id == null)
{
vcard.GenerateId();
}
m_XmppClient.IqFilter.SendIq(vcard, VcardHandlder);
}
Sometimes I get this NullReferenceException (I think only when I request MY own vcard):
at System.Xml.Linq.ElementWriter.WriteElement(XElement e)
at System.Xml.Linq.XElement.WriteTo(XmlWriter writer)
at System.Xml.Linq.XNode.GetXmlString(SaveOptions o)
at System.Xml.Linq.XNode.ToString(SaveOptions options)
at Matrix.Xml.XmppXElement.ToString(Boolean indented)
at Matrix.XmppStream.Send(XmppXElement el)
at Matrix.Xmpp.Client.XmppClient.Send(XmppXElement el)
at Matrix.IqFilter.SendIq(Iq iq, EventHandler`1 callback, Object state)
at Matrix.IqFilter.SendIq(Iq iq, EventHandler`1 cb)
The xml looks like this:
<iq id="MX_10" to="-100001271633341@chat.facebook.com/MatriX_adb117ab_4AB9FD9D449F9" type="get" xmlns="jabber:client">
<vCard xmlns="vcard-temp" />
</iq>
What is the cause for this? Is there another way to get MY vcard photo?
private void RequestVcardAsync(Jid to)
{
if (m_JidPhotoMapping.ContainsKey(to.Bare))
{
return;
}
var vcard = new VcardIq(to)
{
Type = Matrix.Xmpp.IqType.get
};
if (vcard.Id == null)
{
vcard.GenerateId();
}
m_XmppClient.IqFilter.SendIq(vcard, VcardHandlder);
}
Sometimes I get this NullReferenceException (I think only when I request MY own vcard):
at System.Xml.Linq.ElementWriter.WriteElement(XElement e)
at System.Xml.Linq.XElement.WriteTo(XmlWriter writer)
at System.Xml.Linq.XNode.GetXmlString(SaveOptions o)
at System.Xml.Linq.XNode.ToString(SaveOptions options)
at Matrix.Xml.XmppXElement.ToString(Boolean indented)
at Matrix.XmppStream.Send(XmppXElement el)
at Matrix.Xmpp.Client.XmppClient.Send(XmppXElement el)
at Matrix.IqFilter.SendIq(Iq iq, EventHandler`1 callback, Object state)
at Matrix.IqFilter.SendIq(Iq iq, EventHandler`1 cb)
The xml looks like this:
<iq id="MX_10" to="-100001271633341@chat.facebook.com/MatriX_adb117ab_4AB9FD9D449F9" type="get" xmlns="jabber:client">
<vCard xmlns="vcard-temp" />
</iq>
What is the cause for this? Is there another way to get MY vcard photo?