It should be fixed with this commit:
https://github.com/discourse/discourse/commit/3c82f1bf98740077cea30285edcbbb213494f00c