NULL tuples causes NPE when writing

Simple fix to avoid NPE's .