Skip to content

Commit 62dd2ef

Browse files
committed
DevTools should generate an exception when calling installation page
1 parent 9cf5dea commit 62dd2ef

2 files changed

Lines changed: 8 additions & 9 deletions

File tree

src/Plugins/SmartStore.DevTools/DependencyRegistrar.cs

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,5 @@
1-
using System;
2-
using System.Linq;
3-
using System.Linq.Expressions;
4-
using System.Web.Mvc;
5-
using System.Reflection;
61
using Autofac;
7-
using Autofac.Core;
82
using Autofac.Integration.Mvc;
9-
using SmartStore.Core.Plugins;
103
using SmartStore.Core.Data;
114
using SmartStore.Core.Infrastructure;
125
using SmartStore.Core.Infrastructure.DependencyManagement;
@@ -16,13 +9,13 @@
169

1710
namespace SmartStore.DevTools
1811
{
19-
public class DependencyRegistrar : IDependencyRegistrar
12+
public class DependencyRegistrar : IDependencyRegistrar
2013
{
2114
public virtual void Register(ContainerBuilder builder, ITypeFinder typeFinder, bool isActiveModule)
2215
{
2316
builder.RegisterType<ProfilerService>().As<IProfilerService>().InstancePerRequest();
2417

25-
if (isActiveModule)
18+
if (isActiveModule && DataSettings.DatabaseIsInstalled())
2619
{
2720
// intercept ALL public store controller actions
2821
builder.RegisterType<ProfilerFilter>().AsActionFilterFor<SmartController>();

src/Plugins/SmartStore.DevTools/ProfilerHttpModule.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
using System;
22
using System.Web;
3+
using SmartStore.Core.Data;
34
using SmartStore.Core.Infrastructure;
45
using StackExchange.Profiling;
56

@@ -43,6 +44,11 @@ private static bool ShouldProfile(HttpApplication app)
4344
if (app.Context == null || app.Context.Request == null)
4445
return false;
4546

47+
if (!DataSettings.DatabaseIsInstalled())
48+
{
49+
return false;
50+
}
51+
4652
var url = app.Context.Request.AppRelativeCurrentExecutionFilePath;
4753
if (url.StartsWith("~/admin", StringComparison.InvariantCultureIgnoreCase) || url.StartsWith("~/mini-profiler", StringComparison.InvariantCultureIgnoreCase) || url.StartsWith("~/bundles", StringComparison.InvariantCultureIgnoreCase))
4854
{

0 commit comments

Comments
 (0)