This was supposed to be fixed by !1715 (merged), but I missed one of the places where an exception was thrown.