Skip to content

Commit

Permalink
fix: null referance exception
Browse files Browse the repository at this point in the history
  • Loading branch information
MichaelTaylor3D committed Sep 13, 2022
1 parent a586c6c commit 9baf7f6
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/models/staging/staging.model.js
Original file line number Diff line number Diff line change
Expand Up @@ -96,9 +96,11 @@ class Staging extends Model {

// Each child record for the maker needs the new projectId
projectChildRecords.forEach((childRecordSet) => {
projectChildRecords[childRecordSet].forEach((childRecord) => {
childRecord.warehouseProjectId = newMakerWarehouseProjectId;
});
if (projectChildRecords[childRecordSet]) {
projectChildRecords[childRecordSet].forEach((childRecord) => {
childRecord.warehouseProjectId = newMakerWarehouseProjectId;
});
}
});

const issuanceIds = takerProjectRecord.issuances.reduce(
Expand Down Expand Up @@ -248,6 +250,7 @@ class Staging extends Model {

return _.omit(offerResponse, ['success']);
} catch (error) {
console.trace(error);
throw new Error(error.message);
}
};
Expand Down

0 comments on commit 9baf7f6

Please sign in to comment.