This project is read-only.

Object null Exception when deleting an item in Blogroll

Topics: ASP.NET 2.0
Jan 28, 2008 at 5:21 PM
I am using and when I tried to delete an item in Blogroll...I got following exception:

Object reference not set to an instance of an object.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.NullReferenceException: Object reference not set to an instance of an object.

Source Error:

Line 140: XmlNode parent = doc.SelectSingleNode("opml/body");
Line 141: XmlNode child = doc.SelectSingleNode("opml/body/outline@title=\"" + title + "\"");
Line 142: parent.RemoveChild(child);
Line 143: doc.Save(fileName);
Line 144: Updater.UpdateBlogroll();

Source File: e:\WebSites\avalongirl\blog\admin\Pages\Blogroll.aspx.cs Line: 142

Stack Trace:

NullReferenceException: Object reference not set to an instance of an object.
System.Xml.XmlNode.RemoveChild(XmlNode oldChild) +28
adminPagesblogroll.DeleteBlog() in e:\WebSites\avalongirl\blog\admin\Pages\Blogroll.aspx.cs:142
adminPagesblogroll.Page_Load(Object sender, EventArgs e) in e:\WebSites\avalongirl\blog\admin\Pages\Blogroll.aspx.cs:24
System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e) +15
System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) +33
System.Web.UI.Control.OnLoad(EventArgs e) +99
System.Web.UI.Control.LoadRecursive() +47
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1436