MOBILE-3118 siteplugins: Stringify objects copied from otherdata

main
Dani Palou 2019-08-20 12:16:57 +02:00
parent 373a4d0cc7
commit 7fc105dc74
1 changed files with 13 additions and 2 deletions

View File

@ -445,12 +445,23 @@ export class CoreSitePluginsProvider {
// Include only the properties specified in the array.
for (const i in useOtherData) {
const name = useOtherData[i];
args[name] = otherData[name];
if (typeof otherData[name] == 'object' && otherData[name] !== null) {
// Stringify objects.
args[name] = JSON.stringify(otherData[name]);
} else {
args[name] = otherData[name];
}
}
} else {
// Add all the data to args.
for (const name in otherData) {
args[name] = otherData[name];
if (typeof otherData[name] == 'object' && otherData[name] !== null) {
// Stringify objects.
args[name] = JSON.stringify(otherData[name]);
} else {
args[name] = otherData[name];
}
}
}