return on empty strings

This commit is contained in:
teddit 2021-03-31 20:48:59 +02:00
parent 4228e31ee4
commit 156c7ba40a
1 changed files with 3 additions and 0 deletions

View File

@ -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;