Check if directory exists before searching inside.