Javascript error in Google Perspective API plugin

RGJ
Wed, 11 May 2022 08:55:51 +0000
Bug

We’re seeing this:

TypeError: Cannot read properties of undefined (reading 'finally')
    at n.perspectiveSave (https://REDACTED/assets/plugins/discourse-perspective-api-12d54e93711215e76c0e9e41ddcbaff5276b541b4db8c82f8731e6544a60b4c6.js:1:1041)

which seems to come from calling a finally() method while the function before that in the chain is not returning anything under various circumstances (there are three return statements without arguments in the code).

I am not familiar enough with this specific logic to figure out what should be returned in these places.

5 posts - 3 participants