aboutsummaryrefslogtreecommitdiffstats
path: root/app/scripts/migrations/017.js
diff options
context:
space:
mode:
Diffstat (limited to 'app/scripts/migrations/017.js')
-rw-r--r--app/scripts/migrations/017.js21
1 files changed, 12 insertions, 9 deletions
diff --git a/app/scripts/migrations/017.js b/app/scripts/migrations/017.js
index 24959cd3a..5f6d906d6 100644
--- a/app/scripts/migrations/017.js
+++ b/app/scripts/migrations/017.js
@@ -27,14 +27,17 @@ module.exports = {
function transformState (state) {
const newState = state
- const transactions = newState.TransactionController.transactions
- newState.TransactionController.transactions = transactions.map((txMeta) => {
- if (!txMeta.status === 'failed') return txMeta
- if (txMeta.retryCount > 0 && txMeta.retryCount < 2) {
- txMeta.status = 'submitted'
- delete txMeta.err
- }
- return txMeta
- })
+ const { TransactionController } = newState
+ if (TransactionController && TransactionController.transactions) {
+ const transactions = newState.TransactionController.transactions
+ newState.TransactionController.transactions = transactions.map((txMeta) => {
+ if (!txMeta.status === 'failed') return txMeta
+ if (txMeta.retryCount > 0 && txMeta.retryCount < 2) {
+ txMeta.status = 'submitted'
+ delete txMeta.err
+ }
+ return txMeta
+ })
+ }
return newState
}