mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-03 20:45:58 +01:00
fix: dont crash if userData is undefined #7262
This commit is contained in:
@@ -328,7 +328,9 @@ User.addInterstitials = function (callback) {
|
||||
if (!meta.config.gdpr_enabled) {
|
||||
return setImmediate(callback, null, data);
|
||||
}
|
||||
|
||||
if (!data.userData) {
|
||||
return setImmediate(callback, new Error('[[error:invalid-data]]'));
|
||||
}
|
||||
const add = function () {
|
||||
data.interstitials.push({
|
||||
template: 'partials/gdpr_consent',
|
||||
@@ -369,6 +371,10 @@ User.addInterstitials = function (callback) {
|
||||
|
||||
// Forum Terms of Use
|
||||
function (data, callback) {
|
||||
if (!data.userData) {
|
||||
return setImmediate(callback, new Error('[[error:invalid-data]]'));
|
||||
}
|
||||
|
||||
const add = function () {
|
||||
data.interstitials.push({
|
||||
template: 'partials/acceptTos',
|
||||
|
||||
Reference in New Issue
Block a user