From 320e8c0af98f4d72ac0e75adaac65a45c58d20fd Mon Sep 17 00:00:00 2001 From: Mark Stacey Date: Wed, 14 Oct 2020 01:50:50 -0230 Subject: [PATCH] Fix TypeError when `signTypedData` throws (#9596) If the `signTypedData` background function threw an exception, it would return `undefined` to the UI, which would throw another exception in the UI. It now re-throws the error if an error is thrown, which allows the UI to handle the error. I'm not sure why this might fail, and I'm not sure we're handling this failure well, but this is an improvement at least. --- app/scripts/metamask-controller.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/scripts/metamask-controller.js b/app/scripts/metamask-controller.js index f46e437fc..ec22b4840 100644 --- a/app/scripts/metamask-controller.js +++ b/app/scripts/metamask-controller.js @@ -1414,7 +1414,7 @@ export default class MetamaskController extends EventEmitter { } catch (error) { log.info('MetaMaskController - eth_signTypedData failed.', error) this.typedMessageManager.errorMessage(msgId, error) - return undefined + throw error } }