Thanks KyleMac for the report, regebro for the patch, and Aymeric for the test. Backport of 71b5617c24 from master.
71b5617c24