Browse Source
Merge pull request #1401 from easiwin/t/lindexi_check_action
Dispatcher's InvokeAsync check action is null #1400
pull/1412/head
Nikita Tsukanov
9 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with
2 additions and
0 deletions
-
src/Avalonia.Base/Threading/Dispatcher.cs
|
|
|
@ -81,12 +81,14 @@ namespace Avalonia.Threading |
|
|
|
/// <inheritdoc/>
|
|
|
|
public Task InvokeAsync(Action action, DispatcherPriority priority = DispatcherPriority.Normal) |
|
|
|
{ |
|
|
|
Contract.Requires<ArgumentNullException>(action != null); |
|
|
|
return _jobRunner?.InvokeAsync(action, priority); |
|
|
|
} |
|
|
|
|
|
|
|
/// <inheritdoc/>
|
|
|
|
public void Post(Action action, DispatcherPriority priority = DispatcherPriority.Normal) |
|
|
|
{ |
|
|
|
Contract.Requires<ArgumentNullException>(action != null); |
|
|
|
_jobRunner?.Post(action, priority); |
|
|
|
} |
|
|
|
|
|
|
|
|