Added sanity checks so decrypt doesn't blow up on null.

This commit is contained in:
Daniel Kaspo 2017-06-13 20:00:49 -04:00
parent 91c854f2e1
commit 3f6bf916cd
1 changed files with 7 additions and 3 deletions

View File

@ -54,7 +54,11 @@ export default class WalletDecrypt extends Component {
return this.state.decryptionChoice === decryptionChoice.name;
});
return selectedDecryptionChoice.component;
if (!selectedDecryptionChoice) {
return null;
}
return <selectedDecryptionChoice.component />;
}
buildDecryptionChoices() {
@ -93,7 +97,7 @@ export default class WalletDecrypt extends Component {
}
render() {
const DecryptionComponent = this.getDecryptionComponent();
const decryptionComponent = this.getDecryptionComponent();
return (
<section className="container">
@ -113,7 +117,7 @@ export default class WalletDecrypt extends Component {
</section>
<DecryptionComponent />
{decryptionComponent}
</article>
</div>
</article>