Skip to content

Commit

Permalink
Merge pull request #1032 from microsoft/trask/fix-npe
Browse files Browse the repository at this point in the history
Fix NPE
  • Loading branch information
trask authored Aug 26, 2019
2 parents 77cbbc0 + c6f0d2d commit 5a07d11
Showing 1 changed file with 16 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -106,8 +106,7 @@ public Timer startTimer(TimerName timerName) {

@Override
public AuxThreadContext createAuxThreadContext() {
// TODO Auto-generated method stub
return null;
return NopAuxThreadContext.INSTANCE;
}

@Override
Expand Down Expand Up @@ -186,4 +185,19 @@ public int getCurrentSuppressionKeyId() {
public void setCurrentSuppressionKeyId(int suppressionKeyId) {
this.currentSuppressionKeyId = suppressionKeyId;
}

private static class NopAuxThreadContext implements AuxThreadContext {

private static final AuxThreadContext INSTANCE = new NopAuxThreadContext();

@Override
public Span start() {
return NopTransactionService.LOCAL_SPAN;
}

@Override
public Span startAndMarkAsyncTransactionComplete() {
return NopTransactionService.LOCAL_SPAN;
}
}
}

0 comments on commit 5a07d11

Please sign in to comment.