mirror of https://github.com/AMT-Cheif/Stylet.git
EventAction won't throw an exception if the View.ActionTarget is null
This commit is contained in:
parent
fbebf8104c
commit
1775eca741
|
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue