nullref fixes
This commit is contained in:
@@ -35,7 +35,7 @@ namespace Umbraco.Web.Editors.Filters
|
||||
|
||||
private UmbracoContext GetUmbracoContext()
|
||||
{
|
||||
return _umbracoContextAccessor.UmbracoContext ?? Composing.Current.UmbracoContext;
|
||||
return _umbracoContextAccessor?.UmbracoContext ?? Composing.Current.UmbracoContext;
|
||||
}
|
||||
|
||||
protected override bool IsAuthorized(HttpActionContext actionContext)
|
||||
|
||||
@@ -19,7 +19,7 @@ namespace Umbraco.Web.Install
|
||||
|
||||
private IRuntimeState RuntimeState => _runtimeState ?? Current.RuntimeState;
|
||||
|
||||
private UmbracoContext UmbracoContext => _umbracoContextAccessor.UmbracoContext ?? Current.UmbracoContext;
|
||||
private UmbracoContext UmbracoContext => _umbracoContextAccessor?.UmbracoContext ?? Current.UmbracoContext;
|
||||
|
||||
/// <summary>
|
||||
/// THIS SHOULD BE ONLY USED FOR UNIT TESTS
|
||||
|
||||
@@ -69,7 +69,7 @@ namespace Umbraco.Web.Mvc
|
||||
/// <summary>
|
||||
/// Exposes the UmbracoContext
|
||||
/// </summary>
|
||||
protected UmbracoContext UmbracoContext => _umbracoContextAccessor.UmbracoContext ?? Current.UmbracoContext;
|
||||
protected UmbracoContext UmbracoContext => _umbracoContextAccessor?.UmbracoContext ?? Current.UmbracoContext;
|
||||
|
||||
// TODO: try lazy property injection?
|
||||
private IPublishedRouter PublishedRouter => Core.Composing.Current.Factory.GetInstance<IPublishedRouter>();
|
||||
|
||||
Reference in New Issue
Block a user