Hello Community,
I have created one content type in which i have one filed of type page. Author can select the pages for that fields from all the available pages. Now I have following logic responsible to get the url of that selected page:
var targetGuid = item.LinkPage.FirstOrDefault().WebPageGuid;
item.LinkURL = _webPageUrlRetriever.Retrieve(targetGuid, _preferredLanguageRetriever.Get()).GetAwaiter().GetResult().RelativePath;
Now i have assigned one page called Article to above mentioned field and it is generating the link as expected. No when i delete that article page and does not update the link. Then i am getting this error.
Now i want to know how to handle this error in the code. because author might not update and link after deleting any page. So in that case as developer i want to handle it in the code.
Environment
Xperience by Kentico version: [30.5.2]
.NET version: [8]
Execution environment: [SaaS]