SwiftCODA / R6-API

Updated Rainbow Six®: Siege API wrapper for user stats.
MIT License
7 stars 2 forks source link

No operator data on new players #2

Open reality-exe opened 7 months ago

reality-exe commented 7 months ago

When attempting to get player data from someone who's new, it returns server error 500.

Here's what gets logged:

TypeError: Cannot convert undefined or null to object
    at Function.entries (<anonymous>)
    at /home/node/app/src/http/ubi-r6-stats.ts:529:74
    at Generator.next (<anonymous>)
    at fulfilled (/home/node/app/src/http/ubi-r6-stats.ts:5:58)
    at processTicksAndRejections (node:internal/process/task_queues:95:5)
Error: No operator data.
    at /home/node/app/src/http/ubi-r6-stats.ts:168:19
    at Array.forEach (<anonymous>)
    at /home/node/app/src/http/ubi-r6-stats.ts:158:19
    at Generator.next (<anonymous>)
    at fulfilled (/home/node/app/src/http/ubi-r6-stats.ts:5:58)
    at processTicksAndRejections (node:internal/process/task_queues:95:5)
SwiftCODA commented 7 months ago

Thanks. This is a known issue of Ubisoft's and I don't think they're planning to do anything about it. Basically, sometimes the lifetime or operators data will be blank for certain players, often "new" ones.

If you're interested in contributing, go ahead and make a fork of the repo and add a handler for that error in both the lifetime and operators request functions--in a manner that just displays null as the value for operators and lifetime in the final response object.