Check for NULL values before believing the column type.

No matter what type the column says it is, the value could be a NULL,
so we need to check the variant type first. Otherwise we read nonsense
data.