Fix crash if invalid row given.

Return null instead of crashing if row is invalid.