Skip to content

Commit

Permalink
added check for message before doing anything with it (DeviaVir#412)
Browse files Browse the repository at this point in the history
  • Loading branch information
benpdavison authored and DeviaVir committed Jul 27, 2017
1 parent 4e61e77 commit bbe1865
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions extensions/exchanges/bittrex/exchange.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ module.exports = function container(get, set, clear) {
}

if(!data.success) {
if (data.message.match(recoverableErrors)) {
if (data.message && data.message.match(recoverableErrors)) {
return retry('getTrades', func_args, data.message)
}
console.log(data.message)
Expand Down Expand Up @@ -106,7 +106,7 @@ module.exports = function container(get, set, clear) {
}

if(!data.success) {
if (data.message.match(recoverableErrors)) {
if (data.message && data.message.match(recoverableErrors)) {
return retry('getBalance', args, data.message)
}
console.log(data.message)
Expand Down Expand Up @@ -155,7 +155,7 @@ module.exports = function container(get, set, clear) {
}

if(!data.success) {
if (data.message.match(recoverableErrors)) {
if (data.message && data.message.match(recoverableErrors)) {
return retry('getQuote', args, data.message)
}
console.log(data.message)
Expand Down Expand Up @@ -209,7 +209,7 @@ module.exports = function container(get, set, clear) {
}

if(!data.success) {
if (data.message.match(recoverableErrors)) {
if (data.message && data.message.match(recoverableErrors)) {
return retry('trade', args, data.message)
}
console.log(data.message)
Expand Down Expand Up @@ -271,7 +271,7 @@ module.exports = function container(get, set, clear) {
}

if(!data.success) {
if (data.message.match(recoverableErrors)) {
if (data.message && data.message.match(recoverableErrors)) {
return retry('getOrder', args, data.message)
}
console.log(data.message)
Expand Down Expand Up @@ -301,4 +301,4 @@ module.exports = function container(get, set, clear) {
}
}
return exchange
}
}

0 comments on commit bbe1865

Please sign in to comment.