FormServerTemplates
Style Library
SiteCollectionImages
Pages
I got few default sharepoint libraries where and “library settings” click i got exception:

System.NullReferenceException: Object reference not set to an instance of an object. at Microsoft.SharePoint.ApplicationPages.ListEditPage.OnLoad(EventArgs e) at ASP._layouts_listedit_aspx.OnLoad(EventArgs e) at System.Web.UI.Control.LoadRecursive() at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
All my investigations shows that this problem because DocumentTemplateUrl is null!
this.strDocTemplateURL = "";
if (this.iBaseType == SPBaseType.DocumentLibrary)
{
this.strDocTemplateURL = ((SPDocumentLibrary) this.spList).DocumentTemplateUrl;
this.DocumentLibraryGeneralLinks.Visible = true;
}
if (this.strDocTemplateURL.Length != 0)
But one very important note that this bug appears only with custom masterpage!
Default v4 masterpage working without any problems.
Any ideas what can cause a problem there?
This is very strange problem or strange exception at least. But was found control on custom masterpage that can cause this exception.
Was located two lines of code that can cause problem on that settings page:
1) web.Lists.TryGetList(listTitle);
2) RightsSensitiveVisibilityHelper.UserHasRights(PermissionContext.CurrentSite,
SPBasePermissions.AddListItems,
PermissionMode.Any, list);
There is no exception but if we will use one of those methods than exception will appear!
I think that this bug because webpart contains strange code in OnLoad method where its ensuring child controls and creating header:
I don’t know why we have this code but also comments located there “Ensures that the CreateChildControls() is called before events.”.
So I hope this will save time for people that searhing for same error.