This simpler fix that I committed upstream works for me: https://cgit.freedesktop.org/xdg/xdg-utils/commit/?id=a5ec775d7631bf32760acc1c1b54a4905cfdec89