Electroid / mojang-api

Bundle multiple Minecraft APIs into a single GET request.
https://api.ashcon.app/mojang/v2/user/Notch
MIT License
239 stars 18 forks source link

API Fails on default skins (TypeError: Cannot read property 'isEmpty' of undefined) #26

Closed zikeji closed 4 years ago

zikeji commented 4 years ago
TypeError: Cannot read property 'isEmpty' of undefined
    at w (worker.js:15:150720)
    at async i (worker.js:15:158788)

The API endpoint fails when you try and query a user that doesn't have a skin (e.g. a default skin).

Electroid commented 4 years ago

Can you give a username or uuid so I can reproduce?

zikeji commented 4 years ago

Yes - this is my particular user who ran into the issue.

https://api.ashcon.app/mojang/v2/user/Asi3nF3si0nYT

Electroid commented 4 years ago

This is very odd, I have a feeling Mojang has changed their API in some way, I'm investigating. (The code powering my API has not changed)

zikeji commented 4 years ago

Yeah. I tried running your code to debug it myself but couldn't get the master branch running properly. Not sure if that's the branch I should be testing on.

Electroid commented 4 years ago

What's on master updated and a fix was just pushed globally.

Basically Mojang changed the default response from sessionserver.mojang.com, so I had to add some extra nil guards. Fixed in 27867efb037106b28a26fa89a42c9fe19328e393