Page/Picture Library Settings — error at base.onLoad()
A project I’ve been working on just recently had an issue where every time someone tried to view the Library Settings for the Pages library or a Picture Library, they would receive the lovely “Object reference not found” error. At first, we thought it was something with the Pages Library content type (we had added a column for workflow purposes). But then I determined it must be something with the master page because when using the default master, the error didn’t happen.
On our custom master page, there is a custom control. Within that custom control, I used a SortedList object of type SPListItem. For whatever reason, this worked fine on one site collection but not within another site collection, BOTH on the SAME server. Very strange, still haven’t figured that one out.
But after hours of messing around with the master page, determining it was my control causing this and then trying to figure out if it was the custom content type used with the list populating my control or the control itself, I finally dwindled it down to the SortedList object. By setting it to null before exiting the control code (after all of my processing on it was complete), this fixed the error.
Very odd. Still uneasy about the fact that I can’t determine why it worked fine on one site collection and not the other.