fix: dont crash if userData is undefined #7262

This commit is contained in:
Barış Soner Uşaklı
2019-02-06 10:33:04 -05:00
parent a2f08e7da2
commit 56a493d873

View File

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