mirror of
https://github.com/discourse/discourse.git
synced 2025-02-21 03:19:10 +00:00
FIX: currentUser
can be null
This commit is contained in:
parent
ede19943b3
commit
f38347400c
@ -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…
x
Reference in New Issue
Block a user