From 70d346ea951ebfa002225759310d72882a435a5c 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 29e221c8e3d..5e874a49c0c 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 {