bugfix: deal with all-NULL data