Exception when adding code formatted from Word

Topics: Developer Forum, User Forum
Sep 4, 2008 at 3:15 PM
Hi, I get this error when trying to add text from a word document:

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 110:            if (Authority == matchAgainstAuthority)
Line 111: return true;
Line 112: else if(Wildcards && matchAgainstAuthority.EndsWith("." + Authority))
Line 113: return true;
Line 114: return false;

Source File: D:\Work\PrintPlace\WorkArea\LastBox\src\N2\Web\Site.cs    Line: 112

Stack Trace:

[NullReferenceException: Object reference not set to an instance of an object.]
N2.Web.Site.Is(String matchAgainstAuthority) in D:\Work\PrintPlace\WorkArea\LastBox\src\N2\Web\Site.cs:112
N2.Web.MultipleSitesParser.GetSite(String authority) in D:\Work\PrintPlace\WorkArea\LastBox\src\N2\Web\MultipleHostsUrlParser.cs:148
N2.Web.MultipleSitesParser.Parse(String url) in D:\Work\PrintPlace\WorkArea\LastBox\src\N2\Web\MultipleHostsUrlParser.cs:72
N2.Edit.LinkTracker.Tracker.FindLinkedItems(ContentItem item) in D:\Work\PrintPlace\WorkArea\LastBox\src\wwwroot\Edit\LinkTracker\Tracker.cs:72
N2.Edit.LinkTracker.Tracker.OnTrackingLinks(ContentItem item) in D:\Work\PrintPlace\WorkArea\LastBox\src\wwwroot\Edit\LinkTracker\Tracker.cs:44
N2.Edit.LinkTracker.Tracker.persister_ItemSaving(Object sender, CancellableItemEventArgs e) in D:\Work\PrintPlace\WorkArea\LastBox\src\wwwroot\Edit\LinkTracker\Tracker.cs:36
System.EventHandler`1.Invoke(Object sender, TEventArgs e) +0
N2.Persistence.NH.ContentPersister.Invoke(EventHandler`1 handler, T args) in D:\Work\PrintPlace\WorkArea\LastBox\src\N2\Persistence\NH\ContentPersister.cs:314
N2.Persistence.NH.ContentPersister.Save(ContentItem unsavedItem) in D:\Work\PrintPlace\WorkArea\LastBox\src\N2\Persistence\NH\ContentPersister.cs:70
N2.Edit.EditManager.Save(IItemEditor itemEditor, IPrincipal user) in D:\Work\PrintPlace\WorkArea\LastBox\src\N2\Edit\EditManager.cs:331
N2.Web.UI.WebControls.ItemEditor.Save() in D:\Work\PrintPlace\WorkArea\LastBox\src\N2\Web\UI\WebControls\ItemEditor.cs:190
N2.Edit.Edit.OnSaveCommand(Object sender, CommandEventArgs e) in D:\Work\PrintPlace\WorkArea\LastBox\src\wwwroot\Edit\Edit.aspx.cs:164
System.Web.UI.WebControls.LinkButton.OnCommand(CommandEventArgs e) +105
System.Web.UI.WebControls.LinkButton.RaisePostBackEvent(String eventArgument) +132
System.Web.UI.WebControls.LinkButton.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +7
System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +11
System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +177
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1746


Any idea why? Tested with IE7 and Firefox 3.

Thanks,
Adrian
Coordinator
Sep 4, 2008 at 7:35 PM
Looks like a bug. A workaround should be disabling multiple sites: <n2><host multipleSites="false">
Sep 8, 2008 at 10:26 AM
Thanks for the tip, it works now.

Adrian