gauravtyagi2777 / google-gdata

Automatically exported from code.google.com/p/google-gdata
0 stars 0 forks source link

ArgumentNullException when get CalendarEntry.Hidden property value. #443

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
Sometimes, we received calendar query response without <gCal:hidden> tag.

And we get CalendarEntry.Hidden property value, ArgumentNullException occurred.

== CalendarEntry class ==
public bool Hidden{
  get {
    return bool.Parse(
       getCalendarExtensionValue(GDataParserNameTable.XmlHiddenElement));
==

getCalendarExtensionValue(...) return null when no <gCal:hidden> tag.
bool.Parse(null) --> throw AugumentNullException

== exsample to fix ==
  get {
    return bool.Parse(
       getCalendarExtensionValue(GDataParserNameTable.XmlHiddenElement) ?? "false");
==

Original issue reported on code.google.com by mail.to....@gmail.com on 16 Nov 2010 at 6:23

GoogleCodeExporter commented 8 years ago

Original comment by ccherub...@google.com on 7 Dec 2010 at 8:54

GoogleCodeExporter commented 8 years ago
CalendarEntry.Selected property too.

Original comment by mail.to....@gmail.com on 8 Dec 2010 at 8:13

GoogleCodeExporter commented 8 years ago

Original comment by ccherub...@google.com on 8 Dec 2010 at 2:51

GoogleCodeExporter commented 8 years ago
Instead of hard-coding the "false" string value to avoid bool.Parse() throwing 
an exception I'll replace it with a bool.TryParse() block instead.

The fix should be live next week.

Original comment by ccherub...@google.com on 9 Dec 2010 at 5:13

GoogleCodeExporter commented 8 years ago
Fixed in rev. 1055

Original comment by ccherub...@google.com on 13 Dec 2010 at 12:59