I fixed it in the commit below
https://github.com/discourse/discourse/commit/be436066ffa2557427a75d9694da2021e2a31a7c