Fixed getAbsolutePath case when path is "0"

Make sure to correctly check for string emptiness when the passed path
is "0".

Backport of bab8c1f from master