EventAction won't throw an exception if the View.ActionTarget is null

This commit is contained in:
Antony Male 2014-03-19 13:16:40 +00:00
parent fbebf8104c
commit 1775eca741
1 changed files with 4 additions and 1 deletions

View File

@ -86,8 +86,11 @@ namespace Stylet
private void InvokeCommand(object sender, RoutedEventArgs e)
{
if (this.target == null)
return;
var parameters = this.targetMethodInfo.GetParameters().Length == 1 ? new object[] { e } : null;
this.targetMethodInfo.Invoke(target, parameters);
this.targetMethodInfo.Invoke(this.target, parameters);
}
}
}