raykichi / jabber-net

Automatically exported from code.google.com/p/jabber-net
Other
0 stars 0 forks source link

Need error handling check in Time.Utc getter #12

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Gaim returns the <utc> element in a jabber:iq:time query result, but
doesn't fill it in.  The XEP says the <utc> element is required, but the
data in it is only a SHOULD, so I guess this is valid.  At any rate, I
suppose we should be liberal in what we accept and not crash with a NRE.

The packet:
<iq type="result" from="xxxxxx@jabber.org/Home"
to="xxxxxxxx@jabber.org/Test" id="JN_13"><query xmlns="jabber:iq:time"><utc
/><tz>CST</tz><display /></query></iq>

StackTrace:
System.NullReferenceException occurred
  Message="Object reference not set to an instance of an object."
  Source="jabber-net"
  StackTrace:
       at jabber.protocol.Element.JabberDate(String dt) in
D:\Documents\Visual Studio
2005\Projects\jabber-net\jabber\protocol\Element.cs:line 481

Original issue reported on code.google.com by jpo...@gmail.com on 14 Feb 2008 at 10:18

GoogleCodeExporter commented 9 years ago
Does DateTime.MinValue make sense as the response in this case?

Original comment by hil...@gmail.com on 15 Feb 2008 at 12:42

GoogleCodeExporter commented 9 years ago
Yeah, I guess that's about the only choice.

Original comment by jpo...@gmail.com on 15 Feb 2008 at 12:50

GoogleCodeExporter commented 9 years ago
Got it.  Fixed it in JabberDate, so that anything that uses it will get this 
capability.  Also checked for mis-
formatted dates as well.

Original comment by hil...@gmail.com on 15 Feb 2008 at 1:00