From b11a08111e4ac6846df433efb0138a6d9179377b Mon Sep 17 00:00:00 2001
From: Rameleu <antoinecoudraylr@gmail.com>
Date: Tue, 29 Aug 2023 20:25:37 +0200
Subject: [PATCH] fix: fixed crash on buy

---
 private/src/services/offer.service.js | 14 +++++++++-----
 1 file changed, 9 insertions(+), 5 deletions(-)

diff --git a/private/src/services/offer.service.js b/private/src/services/offer.service.js
index a66c419c..a27fe9ef 100644
--- a/private/src/services/offer.service.js
+++ b/private/src/services/offer.service.js
@@ -93,11 +93,15 @@ const initOffer = async ({ user, id }) => {
 				value: `${offer.quantity || 1}x ${offer.item.name} - ${offer.price}`,
 				inline: true
 			},
-			{
-				name: "Stats",
-				value: offer.item.properties.map(p => `${p.value} ${p.name}`).join('\n'),
-				inline: true
-			},
+			...(offer.item.properties.length > 0
+				? [
+					{
+						name: "Stats",
+						value: offer.item.properties.map(p => `${p.value} ${p.name}`).join('\n'),
+						inline: true
+					}
+				]
+				: [])
 		)
 		.setColor("#00b0f4")
 		.setFooter({
-- 
GitLab