wtijsma
-
1/19/2005 12:29:18 PM
ERROR: Searching causes Object reference
Hi Petr,
Error trapping & debugging is very hard because you don't throw useful errors, could you please put some attention to this? As I said before, always trow errors if something goes wrong in a function, don't just return 'nothing' because it will cause problems in other parts of your application.
Error below while searching:
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 451: queriesNode = mXML.CreateNode(XmlNodeType.Element, "queries", ""); Line 452: queriesNode.InnerXml = queriesXML.InnerXml; Line 453: mXML.SelectSingleNode("/applications/application[@id='" + applicationName.ToLower() + "']/classes/class[@id='" + className.ToLower() + "']").AppendChild(queriesNode.SelectSingleNode("queries")); Line 454: } Line 455: }
Source File: C:\Projecten\Website\trunk\src\MetadataEngine_cs\MetadataProvider.cs Line: 453
Stack Trace:
[NullReferenceException: Object reference not set to an instance of an object.] Kentico.CMS.MetadataEngine.MetadataProvider.EnsureQueries(String applicationName, String className) in C:\Projecten\Website\trunk\src\MetadataEngine_cs\MetadataProvider.cs:453 Kentico.CMS.MetadataEngine.MetadataProvider.GetQuery(String queryName) in C:\Projecten\Website\trunk\src\MetadataEngine_cs\MetadataProvider.cs:73 Kentico.CMS.DataEngine.GeneralConnection.RunQuery(String queryName, Object[,] paramsIdent) in C:\Projecten\Website\trunk\src\DataEngine_cs\GeneralConnection.cs:122 Kentico.CMS.DataEngine.GeneralConnection.ExecuteQuery(String queryName, Object[,] paramsIdent) in C:\Projecten\Website\trunk\src\DataEngine_cs\GeneralConnection.cs:89 Kentico.CMS.TreeEngine.TreeProvider.Search(String searchNodePath, TreePathTypeEnum pathType, String searchExpression, SearchModeEnum searchMode, Boolean searchChildNodes, String[] classNames, Boolean filterResultsByReadPermission) in C:\Projecten\Website\trunk\src\TreeEngine_cs\TreeProvider.cs:924 Kentico.CMS.CMSControls.CMSSearchResults.Render(HtmlTextWriter output) in c:\projecten\website\trunk\src\cmscontrols_cs\cmssearchresults.cs:323 System.Web.UI.Control.RenderControl(HtmlTextWriter writer) ASP.search_aspx.__Render__control3(HtmlTextWriter __output, Control parameterContainer) in C:\Projecten\Website\trunk\src\Vitsol\search.aspx:35 System.Web.UI.Control.RenderChildren(HtmlTextWriter writer) System.Web.UI.HtmlControls.HtmlForm.RenderChildren(HtmlTextWriter writer) System.Web.UI.HtmlControls.HtmlContainerControl.Render(HtmlTextWriter writer) System.Web.UI.HtmlControls.HtmlForm.Render(HtmlTextWriter output) System.Web.UI.Control.RenderControl(HtmlTextWriter writer) ASP.search_aspx.__Render__control1(HtmlTextWriter __output, Control parameterContainer) in C:\Projecten\Website\trunk\src\Vitsol\search.aspx:22 System.Web.UI.Control.RenderChildren(HtmlTextWriter writer) System.Web.UI.Control.Render(HtmlTextWriter writer) System.Web.UI.Control.RenderControl(HtmlTextWriter writer) System.Web.UI.Page.ProcessRequestMain()
|