Skip to content

DataCollector error #744

@armandn

Description

@armandn

I'm getting some errors when using DataCollector:

null is not an object (evaluating 'Object.keys(i)')

I use the code like this:

try {
     const dataCollector = await braintree.dataCollector.create({client: clientInstance, kount: true, paypal: true});
     this.deviceData.value = await dataCollector.getDeviceData();
} catch (error) {
    ...
}

Upon investigation, the error occurs in camel-case-to-snake-case.js,

  } else if (typeof input === "object") {
    converted = Object.keys(input).reduce(function (newObj, key) {

because typeof null is object!

The helper function is used by getDeviceData(), but since I await the .create(), deviceSessionId and deviceData should be available...

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions