ignore undefined or null values. fixes #300