adds null check and ensures that SetInternalRedirectPublishedContent cannot be called with a null result
This commit is contained in:
@@ -166,7 +166,8 @@ namespace Umbraco.Web.Routing
|
||||
/// preserve or reset the template, if any.</remarks>
|
||||
public void SetInternalRedirectPublishedContent(IPublishedContent content)
|
||||
{
|
||||
EnsureWriteable();
|
||||
if (content == null) throw new ArgumentNullException("content");
|
||||
EnsureWriteable();
|
||||
|
||||
// unless a template has been set already by the finder,
|
||||
// template should be null at that point.
|
||||
|
||||
@@ -515,11 +515,11 @@ namespace Umbraco.Web.Routing
|
||||
{
|
||||
// redirect to another page
|
||||
var node = _routingContext.UmbracoContext.ContentCache.GetById(internalRedirectId);
|
||||
|
||||
_pcr.SetInternalRedirectPublishedContent(node); // don't use .PublishedContent here
|
||||
|
||||
if (node != null)
|
||||
{
|
||||
redirect = true;
|
||||
_pcr.SetInternalRedirectPublishedContent(node); // don't use .PublishedContent here
|
||||
redirect = true;
|
||||
ProfilingLogger.Logger.Debug<PublishedContentRequestEngine>("{0}Redirecting to id={1}", () => tracePrefix, () => internalRedirectId);
|
||||
}
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user