fix: dont crash if userData is undefined #7262

v1.18.x
Barış Soner Uşaklı 6 years ago
parent a2f08e7da2
commit 56a493d873

@ -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',

Loading…
Cancel
Save