From 1af104867029bcd70a1ddb46d27aeea2e07f6be7 Mon Sep 17 00:00:00 2001 From: anatolykopyl Date: Wed, 6 Jul 2022 19:43:44 +0300 Subject: [PATCH] Fix crash --- gather/src/items/Part.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/gather/src/items/Part.js b/gather/src/items/Part.js index a1db718..f222fde 100644 --- a/gather/src/items/Part.js +++ b/gather/src/items/Part.js @@ -10,6 +10,10 @@ module.exports = class Part { async getPrice () { const orders = await Api.getSortedOrders(this.urlPath) + if (orders.length === 0) { + return 0 + } + return Number(orders[0].platinum) * this.amount } }