Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Preventing a null reference exception from happening when something i…

…s null in an object graph we're evaluating. Working on fixing this for real now.
  • Loading branch information...
commit 990eac0f8b95aeb030ca3d79eab31777a3a069fa 1 parent 3d2cd87
Brandon Behrens bbehrens authored
Showing with 11 additions and 1 deletion.
  1. +11 −1 src/FubuFastPack/Querying/SingleEntityFilter.cs
12 src/FubuFastPack/Querying/SingleEntityFilter.cs
View
@@ -58,7 +58,17 @@ public void Or(Action<IOrOptions<T>>[] orOperations)
orOperation(orOptions);
}
var compile = orOptions.BuildOut().Compile();
- setCanView(compile.Invoke(_domainEntity));
+ var canView = false;
+
+ try
+ {
+ canView = compile.Invoke(_domainEntity);
+ }
+ catch (NullReferenceException) { }
+ finally
+ {
+ setCanView(canView);
+ }
}
public void ApplyRestriction(IDataRestriction<T> restriction)
Please sign in to comment.
Something went wrong with that request. Please try again.