From e8f2c0017035b10b1dd17f78c6fcad767bf89bc7 Mon Sep 17 00:00:00 2001 From: Abhorrent_Anger Date: Sun, 16 Aug 2026 20:55:32 +0300 Subject: [PATCH] Type check --- ManncoStoreGiveawayAutojoiner.user.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/ManncoStoreGiveawayAutojoiner.user.js b/ManncoStoreGiveawayAutojoiner.user.js index ba57311..edb3d7c 100644 --- a/ManncoStoreGiveawayAutojoiner.user.js +++ b/ManncoStoreGiveawayAutojoiner.user.js @@ -1,7 +1,7 @@ // ==UserScript== // @name Mann Co. Store Giveaway Autojoiner // @namespace http://tampermonkey.net/ -// @version 2026-08-18 +// @version 2026-08-19 // @description Tries to join giveaways on page load // @author Abhorrent_Anger // @include /^https?:\/\/mannco\.store\/giveaways.?$/ @@ -48,7 +48,10 @@ const getCookieValue = (name) => ( function getTokenFromCookie(tokenName) { let authArray = getCookieValue(tokenName); let decodedAuthArray = decodeURIComponent(authArray); - let array = JSON.parse(decodedAuthArray) + if (typeof decodedAuthArray !== 'string') { + return false; + } + let array = JSON.parse(decodedAuthArray); if (Array.isArray(array)) { return array['token']; }