Skip to content

Commit

Permalink
Use TryGetValue to lookup worker channel (Azure#3006)
Browse files Browse the repository at this point in the history
* Use TryGetValue to lookup worker channel
  • Loading branch information
pragnagopa authored Jun 14, 2018
1 parent 40e0785 commit 47bd36a
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,8 @@ public void Register(FunctionRegistrationContext context)

public void WorkerError(WorkerErrorEvent workerError)
{
ILanguageWorkerChannel erroredChannel = _channelsDictionary[workerError.WorkerId];
if (erroredChannel != null)
ILanguageWorkerChannel erroredChannel;
if (_channelsDictionary.TryGetValue(workerError.WorkerId, out erroredChannel))
{
// TODO: move retry logic, possibly into worker channel decorator
_channelState.AddOrUpdate(erroredChannel.Config,
Expand Down

0 comments on commit 47bd36a

Please sign in to comment.