fix(cosmos-provider): handle possibly undefined address

This commit is contained in:
Ben Kremer 2022-04-04 15:51:15 +02:00
parent b8515abe6e
commit 32afbb373c

View File

@ -123,6 +123,10 @@ export default function App() {
const address = account.split(":").pop(); const address = account.split(":").pop();
if (!address) {
throw new Error(`Could not derive address from account: ${account}`);
}
// cosmos_signDirect params // cosmos_signDirect params
const params = { const params = {
signerAddress: address, signerAddress: address,
@ -161,6 +165,10 @@ export default function App() {
const address = account.split(":").pop(); const address = account.split(":").pop();
if (!address) {
throw new Error(`Could not derive address from account: ${account}`);
}
// cosmos_signAmino params // cosmos_signAmino params
const params = { signerAddress: address, signDoc }; const params = { signerAddress: address, signDoc };