Fix https://bugs.dojotoolkit.org/ticket/17228 on branch 1.9

As requested previously, here is a fix for https://bugs.dojotoolkit.org/ticket/17228 on branch 1.9.