From 794b2dad9955fb4a43737681a7f1dbd446b9eea9 Mon Sep 17 00:00:00 2001 From: Thibaut Girka Date: Fri, 12 Oct 2018 23:12:39 +0200 Subject: [PATCH] Fix auto-unfold CWs when no regexp is set Fixes #778 --- app/javascript/flavours/glitch/util/content_warning.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/app/javascript/flavours/glitch/util/content_warning.js b/app/javascript/flavours/glitch/util/content_warning.js index 29e221c8e3..5e874a49c0 100644 --- a/app/javascript/flavours/glitch/util/content_warning.js +++ b/app/javascript/flavours/glitch/util/content_warning.js @@ -4,6 +4,11 @@ export function autoUnfoldCW (settings, status) { } const rawRegex = settings.getIn(['content_warnings', 'filter']); + + if (!rawRegex) { + return true; + } + let regex = null; try {