Skip to content
This repository has been archived by the owner on Feb 15, 2022. It is now read-only.

Commit

Permalink
added check for message before doing anything with it (#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 d743617 commit ff2c52f
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 ff2c52f

Please sign in to comment.