Skip to content

Commit

Permalink
fixes #649
Browse files Browse the repository at this point in the history
prevents crashes if NULL is entered as a referrer in the database. Does not guard against submitting NULL to the database.
  • Loading branch information
foxytocin committed May 6, 2021
1 parent 5ecaf55 commit bd8f72d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/filters.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit bd8f72d

Please sign in to comment.