Closed arxcode closed 6 years ago
From a quick look your diagnosis appears absolutely correct. Thank you for the very detailed report, will fix.
Fixed and deployed, lemme know if you still encounter this one.
Wow, that was quick! I tested it again and now it seems to work. Thanks a lot for the great site!
I have a problem while trying to review lib.reviews itself. I do the following:
Note that I have not reviewed lib.reviews before, so I don't think this error should appear. This is confirmed by the fact that the "Edit review" button doesn't do anything when clicking it.
I have looked at the code, but I am not sure if I understand correctly what is going on. In particular this line here:
I am wondering whether the problem might be that an empty array in JavaScript is
truthy
? Because that's what the API returns. My browser requests the following URL (viaGET
):https://lib.reviews/api/thing?url=https://lib.reviews/&userID=xxxxxx
(I replaced my userID with
xxxxxx
.)The API returns the following:
So
reviews
is empty, but a valid array, and thus evaluates to a truthy value, triggering the error?