Skip to content
This repository has been archived by the owner on Nov 6, 2020. It is now read-only.

Filter null transactions for display (not available on node) #3698

Merged
merged 3 commits into from
Dec 2, 2016

Conversation

jacogr
Copy link
Contributor

@jacogr jacogr commented Dec 1, 2016

When the node is syncing and we try to find a non-existent (though valid) hash, the transaction can be null. Filter null retrieved transactions before attempting to add it to the list.

@jacogr jacogr added A0-pleasereview 🤓 Pull request needs code review. M7-ui labels Dec 1, 2016
@@ -93,7 +93,7 @@ export default class Store {
Promise
.all(txhashes.map((txhash) => this._api.eth.getTransactionByHash(txhash)))
.then((_transactions) => {
const transactions = _transactions.filter((tx) => tx);
const transactions = _transactions.filter((tx) => tx) || [];
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Array.prototype.filter always returns an Array.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You are right, mistook myself for using .find there for a moment.

@gavofyork gavofyork added A8-looksgood 🦄 Pull request is reviewed well. and removed A0-pleasereview 🤓 Pull request needs code review. labels Dec 2, 2016
@gavofyork gavofyork merged commit 21a76c2 into master Dec 2, 2016
@gavofyork gavofyork deleted the jg-null-transaction branch December 2, 2016 03:40
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
A8-looksgood 🦄 Pull request is reviewed well.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants