From 7d29014d01df1b366328bdf9722a34e5abc3f1a2 Mon Sep 17 00:00:00 2001 From: Jordan Muir Date: Wed, 4 Aug 2021 22:13:49 -0400 Subject: [PATCH] CCheck for existence of network before updating preset --- main/store/migrations/index.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/main/store/migrations/index.js b/main/store/migrations/index.js index 46f51786d..8c0b470c9 100644 --- a/main/store/migrations/index.js +++ b/main/store/migrations/index.js @@ -297,9 +297,11 @@ const migrations = { return initial }, 14: initial => { - const { primary, secondary } = initial.main.networks.ethereum[137].connection - if (primary.current === 'matic') primary.current = 'infura' - if (secondary.current === 'matic') secondary.current = 'infura' + if (initial.main.networks.ethereum[137] && initial.main.networks.ethereum[137].connection) { + const { primary, secondary } = initial.main.networks.ethereum[137].connection || {} + if (primary.current === 'matic') primary.current = 'infura' + if (secondary.current === 'matic') secondary.current = 'infura' + } // add arbitrum network information if (!initial.main.networks.ethereum[42161]) {