Skip to content

Commit

Permalink
fix(product-import): add check for empty results from CTP (#164)
Browse files Browse the repository at this point in the history
  • Loading branch information
lojzatran authored and Daniel Eriksson committed Jul 19, 2019
1 parent 2b56d51 commit db79674
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lib/product-import.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -719,6 +719,8 @@ class ProductImport
else
if _.size(result.body.results) > 1
@logger.warn "Found more than 1 #{refKey} for #{ref.id}"
if _.isEmpty(result.body.results)
reject "Inconsistency between body.count and body.results.length. Result is #{JSON.stringify(result)}"
@_cache[refKey][ref.id] = result.body.results[0]
@_cache[refKey][result.body.results[0].id] = result.body.results[0]
resolve(result.body.results[0].id)
Expand Down

0 comments on commit db79674

Please sign in to comment.