Skip to content
This repository was archived by the owner on Jun 27, 2019. It is now read-only.

Commit 18681cd

Browse files
committed
Fix usersettings hook if data === undefined
When I run the seed data, I get several error messages when I want to delete my account. The error that is fixed with this commit is ``` Cannot read property 'blacklist' of undefined ``` Another error which pops up is ``` Cannot read property 'Forbidden' of undefined ``` This error is **NOT** resolved with this commit. Fortunately, some resources get deleted when the user pushes the button, so all you have to do is to click the "delete account" button multiple times.
1 parent 97d640d commit 18681cd

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

server/services/usersettings/hooks/validate-blacklist.js

+1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ const { BadRequest } = require('@feathersjs/errors');
33
const validateBlacklist = () => {
44
return async (hook) => {
55
const { data } = hook;
6+
if (!data) return hook;
67
const blacklist = data.blacklist;
78
if (!blacklist) return hook;
89
const userId = data.userId;

0 commit comments

Comments
 (0)