Closed tdesvenain closed 6 years ago
When I test for non null or undefined before throw, it just works as I expect
// Populate column on each row
rows.forEach(function (row) {
var foreignKey = row[targetIndex];
var record = lookup[foreignKey];
if (foreignKey !== null && foreignKey !== undefined && !record) { // test if not null or undefined
throw new Error(
"Could not lookup foreign key where " +
tableName + "." + foreignIndex + " == " + baseTable + "." + column + ". " +
"The content of the failing key was: " + (JSON.stringify(foreignKey)) + ".")
}
would you agree with such a change ?
Hi do you have an opinion about this fix ?
Hi! Sorry for getting into this so late. Notification emails for this library went into gmail's Forum tab. I've created a rule to get it right in future.
Yes, I agree totally. If you PR, I'll gladly merge it.
Could not lookup foreign key where ... The content of the failing key was: null.
In my opinion the relation property should just be null there.