From 64827118ac8a75d18dd8fa5ce6b2b706c9d02184 Mon Sep 17 00:00:00 2001 From: NoLifeKing Date: Sun, 5 Jun 2022 09:20:29 +0200 Subject: [PATCH] fix: Don't try to replace strings that doesn't exist (undefined) --- src/scripts/destiny2/goalItems.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/scripts/destiny2/goalItems.js b/src/scripts/destiny2/goalItems.js index b0c6ed8..c3560f5 100644 --- a/src/scripts/destiny2/goalItems.js +++ b/src/scripts/destiny2/goalItems.js @@ -40,7 +40,7 @@ export class Destiny2Goals { }; this.replaceStringVariables = function (string, profileVariables) { - if (string.indexOf("{var:") === -1) return string; + if (!string || string.indexOf("{var:") === -1) return string; var matchRegex = /{var:(\d+)}/g; var allMatches = string.match(matchRegex);