From 156c7ba40a34bddef3849e430e4856a7b01ddacb Mon Sep 17 00:00:00 2001 From: teddit Date: Wed, 31 Mar 2021 20:48:59 +0200 Subject: [PATCH] return on empty strings --- inc/commons.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/inc/commons.js b/inc/commons.js index 9a3e526..3e89e68 100644 --- a/inc/commons.js +++ b/inc/commons.js @@ -168,6 +168,9 @@ module.exports = function(request, fs) { } this.replacePrivacyDomains = (str, user_preferences) => { + if(typeof(str) == 'undefined' || !str) + return + let redditRegex = /([A-z.]+\.)?(reddit(\.com)|redd(\.it))/gm; let youtubeRegex = /([A-z.]+\.)?youtu(be\.com|\.be)/gm; let twitterRegex = /([A-z.]+\.)?twitter\.com/gm;