diff --git a/4chan_x.user.js b/4chan_x.user.js index fd540aad3..e991fc2a7 100644 --- a/4chan_x.user.js +++ b/4chan_x.user.js @@ -2231,7 +2231,7 @@ sauce = { init: function() { - sauce.prefixes = conf['flavors'].match(/^[^#].+$/gm); + if (!(sauce.prefixes = conf['flavors'].match(/^[^#].+$/gm)).length) return; sauce.names = sauce.prefixes.map(function(prefix) { return prefix.match(/(\w+)\./)[1]; }); diff --git a/changelog b/changelog index 72b6b135f..fdf2cf3f6 100644 --- a/changelog +++ b/changelog @@ -1,4 +1,6 @@ master +- mayhem + fix empty sauce or all flavors commented out from breaking 4chan X 2.23.5 - mayhem diff --git a/script.coffee b/script.coffee index 95bf48241..0a0394d2d 100644 --- a/script.coffee +++ b/script.coffee @@ -1790,7 +1790,7 @@ anonymize = sauce = init: -> - sauce.prefixes = conf['flavors'].match /^[^#].+$/gm + return unless (sauce.prefixes = conf['flavors'].match /^[^#].+$/gm).length sauce.names = sauce.prefixes.map (prefix) -> prefix.match(/(\w+)\./)[1] g.callbacks.push (root) -> return if root.className is 'inline' or not span = $ '.filesize', root