Fix crash on invalid path selection