Skip to content

Commit

Permalink
fix empty ticker causing request to fail. (coingecko#1398)
Browse files Browse the repository at this point in the history
  • Loading branch information
wongy91 authored Mar 1, 2019
1 parent 515a938 commit a4c4063
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion lib/cryptoexchange/exchanges/freiexchange/services/market.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ def ticker_url
def adapt_all(output)
output.map do |pair, ticker|
ticker = ticker.first
next if ticker.nil?

if pair && ticker
base, target = pair.split("_")
market_pair = Cryptoexchange::Models::MarketPair.new(
Expand All @@ -29,7 +31,7 @@ def adapt_all(output)
)
adapt(market_pair, ticker)
end
end
end.compact
end

def adapt(market_pair, output)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ def fetch

def adapt(output)
output.map do |pair, output|
base, target = pair.split("_")
base, target = pair.split("_")
Cryptoexchange::Models::MarketPair.new(
base: base,
target: target,
Expand Down

0 comments on commit a4c4063

Please sign in to comment.