An error occurred while attaching module (Dynamicweb.Frontend.Content)

System.NullReferenceException: Object reference not set to an instance of an object.
   at Dynamicweb.Content.Items.Queries.Repository.IsPageAllowed(Page page)
   at Dynamicweb.Content.Items.Queries.Repository.GetPagesByIds(IEnumerable`1 parentIds, Boolean includeChildItems, Boolean checkPermissions, List`1& childPages)
   at Dynamicweb.Content.Items.Queries.Repository.SelectByParentPageIds(IEnumerable`1 parentIds, Query query, Boolean includeParagraphs, Boolean includeChildItems, Boolean checkPermissions, Boolean includeInheritedItems)
   at Dynamicweb.ItemPublisher.Frontend.GetItems()
   at Dynamicweb.ItemPublisher.Frontend.List()
   at Dynamicweb.ItemPublisher.Frontend.GetContent()
   at Dynamicweb.Frontend.Content.GetModuleOutput(Paragraph paragraph, PageView pageview)