Skip to content

Commit

Permalink
Cannot read property 'toString' of undefined
Browse files Browse the repository at this point in the history
  • Loading branch information
freshlogic committed May 13, 2022
1 parent 7acfd72 commit 43bb2eb
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ module.exports = {
},
extends: 'eslint:recommended',
parserOptions: {
ecmaVersion: 2019
ecmaVersion: 2022
},
rules: {
'brace-style': ['error', '1tbs', { allowSingleLine: true }],
Expand Down
4 changes: 2 additions & 2 deletions carriers/pitneyBowes.js
Original file line number Diff line number Diff line change
Expand Up @@ -117,11 +117,11 @@ function PitneyBowes(options) {
return;
}

if (DELIVERED_TRACKING_STATUS_CODES.includes(scanDetail.scanType.toString())) {
if (DELIVERED_TRACKING_STATUS_CODES.includes(scanDetail?.scanType?.toString())) {
results.deliveredAt = new Date(event.date);
}

if (SHIPPED_TRACKING_STATUS_CODES.includes(scanDetail.scanType.toString())) {
if (SHIPPED_TRACKING_STATUS_CODES.includes(scanDetail?.scanType?.toString())) {
results.shippedAt = new Date(event.date);
}

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,5 +39,5 @@
"type": "git",
"url": "https://github.com/mediocre/bloodhound.git"
},
"version": "1.8.1"
"version": "1.8.2"
}

0 comments on commit 43bb2eb

Please sign in to comment.