I’ve fixed it here
https://github.com/discourse/discourse/commit/1390eb2957b89f04adce0b92a8cca83f22c30a04