Fix crash when passed an empty string.

I noticed an assertion failure when passing an empty string. This fixes the crash by detecting the empty string early and just returning an empty string.