Check for valid work_dir so we don't insert null items into the database