Object reference not set to an instance of an object.

Server Error in '/' Application.

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 510:    {
Line 511:        DataSet ds = CMS.CMSHelper.TreeHelper.SelectNodes(CMS.CMSHelper.CMSContext.CurrentAliasPath + "/%", true, "BCTD.MediaLibraryReference");
Line 512:        if (ds.Tables.Count!=0)
Line 513:            return ds.Tables[0].Rows[0]["MediaLibrary"].ToString();
Line 514:        else

Source File: d:\inetpub\wwwroot\Oswego\BCTD\v5.0\CMSWebParts\MediaLibrary\CustomMediaGallery.ascx.cs    Line: 512

Stack Trace:


[NullReferenceException: Object reference not set to an instance of an object.]
   CMSWebParts_MediaLibrary_CustomMediaGallery.GetMediaLibraryName() in d:\inetpub\wwwroot\Oswego\BCTD\v5.0\CMSWebParts\MediaLibrary\CustomMediaGallery.ascx.cs:512
   CMSWebParts_MediaLibrary_CustomMediaGallery.get_MediaLibraryName() in d:\inetpub\wwwroot\Oswego\BCTD\v5.0\CMSWebParts\MediaLibrary\CustomMediaGallery.ascx.cs:491
   CMSWebParts_MediaLibrary_CustomMediaGallery.OnContentLoaded() in d:\inetpub\wwwroot\Oswego\BCTD\v5.0\CMSWebParts\MediaLibrary\CustomMediaGallery.ascx.cs:748
   CMS.PortalControls.CMSWebPartZone.OnContentLoaded() +124
   CMS.PortalControls.CMSAbstractLayout.OnContentLoaded() +114
   CMS.PortalControls.CMSAbstractLayout.LoadContent(PageInfo pageInfo, Boolean reloadData, Boolean allowOrphanedZones) +1060
   CMS.PortalControls.CMSPagePlaceholder.LoadContent(PageInfo pageInfo, Boolean reloadData) +1230
   CMS.PortalControls.CMSPagePlaceholder.LoadContent(PageInfo pageInfo, Boolean reloadData) +1393
   CMS.PortalControls.CMSPortalManager.LoadContent(Boolean reloadData) +1128
   CMS.PortalControls.CMSPortalManager.CMSPortalManager_Init(Object sender, EventArgs e) +73
   System.Web.UI.Control.OnInit(EventArgs e) +99
   System.Web.UI.Control.InitRecursive(Control namingContainer) +321
   System.Web.UI.Control.InitRecursive(Control namingContainer) +198
   System.Web.UI.Control.InitRecursive(Control namingContainer) +198
   System.Web.UI.Control.InitRecursive(Control namingContainer) +198
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +834


Version Information: Microsoft .NET Framework Version:2.0.50727.1433; ASP.NET Version:2.0.50727.1433