Replaced old logic to check for valid path
Travis Person authored
Added the original logic to check for a invalid path and a simple test.
dcc4da0b