From c2d3d057a5d4a55bdb6ff1721637273ec07f30be Mon Sep 17 00:00:00 2001 From: Stephan Date: Wed, 2 Nov 2016 13:35:32 +0100 Subject: [PATCH] U4-9137 - Fix PublishedMediaCache getting trashed media --- .../PublishedCache/XmlPublishedCache/PublishedMediaCache.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Umbraco.Web/PublishedCache/XmlPublishedCache/PublishedMediaCache.cs b/src/Umbraco.Web/PublishedCache/XmlPublishedCache/PublishedMediaCache.cs index da1ff94fe1..f3cc101b21 100644 --- a/src/Umbraco.Web/PublishedCache/XmlPublishedCache/PublishedMediaCache.cs +++ b/src/Umbraco.Web/PublishedCache/XmlPublishedCache/PublishedMediaCache.cs @@ -226,7 +226,7 @@ namespace Umbraco.Web.PublishedCache.XmlPublishedCache // the media from the service, first var media = ApplicationContext.Current.Services.MediaService.GetById(id); - if (media == null) return null; // not found, ok + if (media == null || media.Trashed) return null; // not found, ok // so, the media was not found in Examine's index *yet* it exists, which probably indicates that // the index is corrupted. Or not up-to-date. Log a warning, but only once, and only if seeing the