mirror of
https://github.com/NodeBB/NodeBB.git
synced 2026-07-09 23:02:04 +02: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) {
|
if (!meta.config.gdpr_enabled) {
|
||||||
return setImmediate(callback, null, data);
|
return setImmediate(callback, null, data);
|
||||||
}
|
}
|
||||||
|
if (!data.userData) {
|
||||||
|
return setImmediate(callback, new Error('[[error:invalid-data]]'));
|
||||||
|
}
|
||||||
const add = function () {
|
const add = function () {
|
||||||
data.interstitials.push({
|
data.interstitials.push({
|
||||||
template: 'partials/gdpr_consent',
|
template: 'partials/gdpr_consent',
|
||||||
@@ -369,6 +371,10 @@ User.addInterstitials = function (callback) {
|
|||||||
|
|
||||||
// Forum Terms of Use
|
// Forum Terms of Use
|
||||||
function (data, callback) {
|
function (data, callback) {
|
||||||
|
if (!data.userData) {
|
||||||
|
return setImmediate(callback, new Error('[[error:invalid-data]]'));
|
||||||
|
}
|
||||||
|
|
||||||
const add = function () {
|
const add = function () {
|
||||||
data.interstitials.push({
|
data.interstitials.push({
|
||||||
template: 'partials/acceptTos',
|
template: 'partials/acceptTos',
|
||||||
|
|||||||
Reference in New Issue
Block a user