mirror of
https://github.com/codeninjasllc/discourse.git
synced 2024-11-27 09:36:19 -05:00
FIX: currentUser
can be null
This commit is contained in:
parent
ede19943b3
commit
f38347400c
1 changed files with 2 additions and 1 deletions
|
@ -8,8 +8,9 @@ const ATTRIBUTES_REGEX = new RegExp("(" + WHITELISTED_ATTRIBUTES.join("|") + ")=
|
|||
|
||||
registerOption((siteSettings, opts) => {
|
||||
const currentUser = (opts.getCurrentUser && opts.getCurrentUser(opts.userId)) || opts.currentUser;
|
||||
const staff = currentUser && currentUser.staff;
|
||||
|
||||
opts.features.poll = !!siteSettings.poll_enabled || currentUser.staff;
|
||||
opts.features.poll = !!siteSettings.poll_enabled || staff;
|
||||
opts.pollMaximumOptions = siteSettings.poll_maximum_options;
|
||||
});
|
||||
|
||||
|
|
Loading…
Reference in a new issue