Developer forum

Forum » Dynamicweb 9.0 Upgrade issues » Dynamicweb.Content.PageService.GetPagesByParentID(int parentId) fails if parentid page does not exist

Dynamicweb.Content.PageService.GetPagesByParentID(int parentId) fails if parentid page does not exist

Lars Larsen
Lars Larsen
Reply

Hi

Dynamicweb.Content.PageService.GetPagesByParentID(int parentId) fails with a .Net error (Object reference not set to an instance of an object) if parentid page does not exist. Could you fix it so that the method returns an empty IEnumerable<Page> collection if the parentid page does not exist?7

Running DW v9.2.8


Replies

 
Nicolai Pedersen
Reply
This post has been marked as an answer

Hi Lars

I've made a fix so it returns nothing when the pageid does not exist. That would be a better solution.

In your code, check for null.

Will be in the next hotfix for 9.2

Votes for this answer: 1

 

You must be logged in to post in the forum