Permalink
Browse files

Logic -->DashBoards are not objectviews

  • Loading branch information...
1 parent a27244f commit 5b274c9d207860d612b6a826cfdddfce9edfdfe3 @apobekiaris apobekiaris committed Apr 30, 2012
Showing with 6 additions and 3 deletions.
  1. +6 −3 Xpand/Xpand.ExpressApp.Modules/Logic/LogicRuleViewController.cs
@@ -121,9 +121,12 @@ public abstract class LogicRuleViewController<TModelLogicRule> : ViewController
void ApplicationOnViewCreating(object sender, ViewCreatingEventArgs viewCreatingEventArgs) {
if (Application != null) {
- var typeInfo = Application.Model.Views.Single(modelView => modelView.Id == viewCreatingEventArgs.ViewID).AsObjectView.ModelClass.TypeInfo;
- Active[ActiveObjectTypeHasRules] = LogicRuleManager<TModelLogicRule>.HasRules(typeInfo);
- ForceExecution(Active[ActiveObjectTypeHasRules], null, false, ExecutionContext.ViewCreating);
+ var modelObjectView = Application.Model.Views.Single(modelView => modelView.Id == viewCreatingEventArgs.ViewID).AsObjectView;
+ if (modelObjectView!= null) {
+ var typeInfo = modelObjectView.ModelClass.TypeInfo;
+ Active[ActiveObjectTypeHasRules] = LogicRuleManager<TModelLogicRule>.HasRules(typeInfo);
+ ForceExecution(Active[ActiveObjectTypeHasRules], null, false, ExecutionContext.ViewCreating);
+ }
}
}

0 comments on commit 5b274c9

Please sign in to comment.