Fix bug where a null value in the parent table of a FK used for a join

would cause a NullValueException.