From bd8f72daab4a4afc6d8aa4583bba728da071264f Mon Sep 17 00:00:00 2001 From: Andreas Fuchs Date: Thu, 6 May 2021 10:04:37 +0200 Subject: [PATCH] fixes #649 prevents crashes if NULL is entered as a referrer in the database. Does not guard against submitting NULL to the database. --- lib/filters.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/filters.js b/lib/filters.js index 1c0e7916..733dab94 100644 --- a/lib/filters.js +++ b/lib/filters.js @@ -51,7 +51,7 @@ export const refFilter = (data, { domain, domainOnly, raw }) => { const links = {}; const isValidRef = ref => { - return ref !== '' && !ref.startsWith('/') && !ref.startsWith('#'); + return ref !== '' && ref !== null && !ref.startsWith('/') && !ref.startsWith('#'); }; if (raw) {