You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Release date can be empty in xml string. DateTime.parse throws an
exception.
Possible fix (check for empty value, return Nullable DateTime)
/// <summary>
/// Returns the album's release date.
/// </summary>
/// <returns>
/// A <see cref="DateTime"/>
/// </returns>
public DateTime? GetReleaseDate()
{
XmlDocument doc = request("album.getInfo");
string releaseDate = extract(doc, "releasedate");
if (!string.IsNullOrEmpty(releaseDate))
return DateTime.Parse(releaseDate);
return null;
}
Maybe even do a DateTime.TryParse
Original issue reported on code.google.com by mkrijten...@gmail.com on 28 Apr 2010 at 8:17
The text was updated successfully, but these errors were encountered:
Original issue reported on code.google.com by
mkrijten...@gmail.com
on 28 Apr 2010 at 8:17The text was updated successfully, but these errors were encountered: