Skip to content
This repository has been archived by the owner on Dec 11, 2019. It is now read-only.

Commit

Permalink
Merge pull request #4514 from brave/ledger-safety
Browse files Browse the repository at this point in the history
handle getBraveryProperties error
  • Loading branch information
mrose17 authored Oct 4, 2016
2 parents e2037f6 + 666bd9f commit 0274699
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion app/ledger.js
Original file line number Diff line number Diff line change
Expand Up @@ -1245,9 +1245,15 @@ var getPaymentInfo = () => {
}

var setPaymentInfo = (amount) => {
var bravery

if (!client) return

var bravery = client.getBraveryProperties()
try { bravery = client.getBraveryProperties() } catch (ex) {
// wallet being created...

return setTimeout(function () { setPaymentInfo(amount) }, 2 * msecs.second)
}

amount = parseInt(amount, 10)
if (isNaN(amount) || (amount <= 0)) return
Expand Down

0 comments on commit 0274699

Please # to comment.