Skip to content

Commit

Permalink
Always return chained promise so state will be restored before execut…
Browse files Browse the repository at this point in the history
…ion continues
  • Loading branch information
ghengeveld committed Aug 10, 2022
1 parent f46a08c commit 501b7e1
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions code/lib/instrumenter/src/instrumenter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -502,9 +502,8 @@ export class Instrumenter {
const res = arg(...args);

// Reset cursor and ancestors to their original values before we entered the callback.
if (res instanceof Promise) res.then(restore, restore);
else restore();

if (res instanceof Promise) return res.then(restore, restore);
restore();
return res;
};
});
Expand Down

0 comments on commit 501b7e1

Please sign in to comment.