Skip to content

Commit

Permalink
prevent transactionReducerV2 from returning undefined (#508)
Browse files Browse the repository at this point in the history
* prevent transactionReducerV2 from returning undefined

* Update lib/reducers/cosmosV0-reducers.js

Co-Authored-By: Ana G. <[email protected]>

* linting fix

Co-authored-by: Ana G. <[email protected]>
  • Loading branch information
iambeone and Bitcoinera authored Mar 24, 2020
1 parent 10145ba commit c43dbde
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions lib/reducers/cosmosV0-reducers.js
Original file line number Diff line number Diff line change
Expand Up @@ -562,13 +562,12 @@ function transactionReducerV2(transaction, reducers, stakingDenom) {
transaction.logs && transaction.logs[index]
? transaction.logs[index].success || false
: false,
log: transaction.logs
? transaction.logs[index].log
log:
transaction.logs && transaction.logs[index]
? transaction.logs[index].log
: transaction.logs[0] // failing txs show the first logs
? transaction.logs[0].log
: ''
: JSON.parse(transaction.raw_log).message,
? transaction.logs[index].log || transaction.logs[0] // failing txs show the first logs
: transaction.logs[0].log || ''
: JSON.parse(transaction.raw_log).message,
involvedAddresses: _.uniq(reducers.extractInvolvedAddresses(transaction))
}))
return returnedMessages
Expand All @@ -577,6 +576,7 @@ function transactionReducerV2(transaction, reducers, stakingDenom) {
scope.setExtra('transaction', transaction)
Sentry.captureException(error)
})
return [] // must return something differ from undefined
}
}

Expand Down

0 comments on commit c43dbde

Please sign in to comment.