Skip to content

React Native: TypeError: undefined is not an object (evaluating 'originalCallback.call') #692

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

Closed
marcello3d opened this issue Aug 18, 2016 · 2 comments

Comments

@marcello3d
Copy link

Getting an exception here: https://github.com/getsentry/raven-js/blob/master/plugins/react-native.js#L89

TypeError: undefined is not an object (evaluating 'originalCallback.call')

Adding a guard seems to resolve the problem, though I don't understand the source enough to know if that's the right solution:

    Raven.setShouldSendCallback(function(data, originalCallback) {
        if (originalCallback && !(FATAL_ERROR_KEY in data)) {
            return originalCallback.call(this, data);
        }
@benvinegar
Copy link
Contributor

This code should definitely guard against originalCallback not being defined. Feeling bad I didn't notice this during review.

Thanks for reporting, we'll have a patch soon.

cc @nevir

@nevir
Copy link
Contributor

nevir commented Aug 18, 2016

Doh! Sorry about that :(

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants