We do not catch any exceptions except when controls render in design time (edit mode of page). This is needed because if a control throws an exception, there won’t be any way to remove the control form the page or change its properties to avoid the exception.
Unfortunately, I’m unable to help in your case without having your code. The two lines of code you posted should not cause any problems though usually there is no need to create a new instance of SiteMapProvider. You can obtain a reference to the provider like this:
SiteMapProvider provider = SiteMap.Providers["CmsSiteMapProvider"];
A better way to get the current node would be to use SiteMap.CurrentNode
which will retrieve the current node using the default provider.
Note that there are situation where the CurrentNode
property can return null reference. In RC1 the current node will be null for non-navigable pages and page templates. This issue has already been fixed.