Fixed getAbsolutePath case when path is "0"

Make sure to correctly check for string emptiness when the passed path
is "0".

Fixes #8564 

Please review @icewind1991 @schiesbn @LukasReschke