Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix TypeError during instrumentation #215

Commits on Apr 6, 2016

  1. Fix TypeError during instrumentation

    We've been receiving errors like the following, which are crashing our processes:
    
    ```
    TypeError: Cannot read property 'transaction' of null
        at Layer.wrappedLayerHandleRequest [as handle_request] (/src/node_modules/newrelic/lib/instrumentation/express.js:305:35)
        at /src/node_modules/express/lib/router/index.js:277:22
        ...
    ```
    
    It appears that, for whatever reason, `tracer.getSegment()` is returning null, and execution of the following line of code when this happens causes an unhandled error. This adds a simple null/undefined check to avoid that and continue with the request the same way as with an inactive transaction.
    jpage-godaddy committed Apr 6, 2016
    Configuration menu
    Copy the full SHA
    844a978 View commit details
    Browse the repository at this point in the history