updated ignore. Fixed issue when media is not found and YSOD is displayed.
This commit is contained in:
@@ -54,3 +54,4 @@ src/Umbraco.Web.UI/Views/*.cshtml
|
||||
src/Umbraco.Web.UI/Views/*.vbhtml
|
||||
src/Umbraco.Tests/config/umbracoSettings.config
|
||||
src/Umbraco.Web.UI/App_Plugins/*
|
||||
src/Umbraco.Web.UI/Views/*
|
||||
|
||||
@@ -70,8 +70,17 @@ namespace Umbraco.Web
|
||||
var media = global::umbraco.library.GetMedia(id, true);
|
||||
if (media != null && media.Current != null)
|
||||
{
|
||||
media.MoveNext();
|
||||
return ConvertFromXPathNavigator(media.Current);
|
||||
if (media.MoveNext())
|
||||
{
|
||||
var current = media.Current;
|
||||
//error check
|
||||
if (media.Current.MoveToFirstChild() && media.Current.Name.InvariantEquals("error"))
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
return ConvertFromXPathNavigator(current);
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
|
||||
Reference in New Issue
Block a user