Skip to content

Commit ab58668

Browse files
Martin Bühlmannvb2ae
authored andcommitted
Fix NullReferenceException when EnableGuardDuringInvocation is set to true and no Func<Bool> CanExecute set.
1 parent 4d4a98d commit ab58668

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Caliburn.Micro.Platform/ActionMessage.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -416,7 +416,7 @@ protected override void Invoke(object eventArgs)
416416

417417
_context.EventArgs = eventArgs;
418418

419-
if (EnforceGuardsDuringInvocation && (_context?.CanExecute() != true))
419+
if (EnforceGuardsDuringInvocation && _context.CanExecute != null && !_context.CanExecute())
420420
{
421421
return;
422422
}

0 commit comments

Comments
 (0)