fixed crash when trying to patch an invalid path