From cc864adf097ecd944c444c1c3d45db9def50e1b3 Mon Sep 17 00:00:00 2001 From: muchnameless Date: Tue, 23 Feb 2021 18:44:25 +0100 Subject: [PATCH] fix(Pet): check if data.petStats exists --- src/structures/Pet.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/structures/Pet.js b/src/structures/Pet.js index 4689c592..4404c340 100644 --- a/src/structures/Pet.js +++ b/src/structures/Pet.js @@ -24,7 +24,7 @@ class Pet { * @type {boolean} */ this.active = data.currentPet === name.toUpperCase(); - const stats = data.petStats[name.toUpperCase()]; + const stats = data.petStats && data.petStats[name.toUpperCase()]; /** * Stats of the pet, if any * @type {object}