I thought that I knew how to handle those NullReferenceExceptions...but I simply don't know what to do with this one
Part of my Code:
Anyone that can give a good explanation why this happens? (On the red line)Code:public class Chapter { public string Name; public TimeSpan Time; } public class ChapterSet { public List<Chapter> Chapters; } public ArrayList GrabChapters(string searchString) { ...(Unimportant code)... foreach (XmlNode node in NodeList) { ChapterSet chapterSet = new ChapterSet(); XmlNodeList chapters = node.ChildNodes; foreach (XmlNode chapter in chapters) { Chapter pChapter = new Chapter(); pChapter.Name = chapter.Attributes["name"].Value; pChapter.Time = TimeSpan.Parse(chapter.Attributes["time"].Value); chapterSet.Chapters.Add(pChapter); } Results.Add(chapterSet); } return Results; }





Reply With Quote