Application ID: 22CC00A4-B93C-CA9C-FFD5-FB6375F62400
Oops. An internal error [6b79899a10a9a85f27b3e7744d389c36] has occurred. We are working on it. Please try again later
Problem description
I was finishing the logical part of a button when at some point the internal error alerts started flashing on my screen.
I think it’s a UI-Builder coding error.
Placed the js code produced by the UI-Builder below, you can find the error in the line marked with !!! ERROR LINE !!!
define([], () => ({
/* content */
/* handler:onClick */
async onClick(___arguments) {
var risparmioInternet, soluzionePrezzoInternet, risparmioGas, soluzionePrezzoGas, risparmioEnergia, soluzionePrezzoEnergia;
function getObjectProperty(object, propPath) {
if (object == null || typeof propPath !== 'string' || object.hasOwnProperty(propPath)) {
return object[propPath]
}
const propsNamesList = propPath.split('.')
let result = object
for (let i = 0; i < propsNamesList.length; i++) {
if (!result || !result.hasOwnProperty(propsNamesList[i])) {
return
}
result = result[propsNamesList[i]]
}
return result
}
await Backendless.Data.of('SDB').save(({ 'EnergiaPrezzoUtenze': (getObjectProperty(___arguments.context.pageData, 'prezzoEnergia')),'EnergiaConsumoAnnuo': (getObjectProperty(___arguments.context.pageData, 'consumoEnergia')),'GasPrezzoUtenza': (getObjectProperty(___arguments.context.pageData, 'prezzoGas')),'GasConsumoAnnuo': (getObjectProperty(___arguments.context.pageData, 'consumoGas')),'InternetPrezzoUtenza': (getObjectProperty(___arguments.context.pageData, 'prezzoInternet')) }), true);
if ((getObjectProperty(___arguments.context.pageData, 'prezzoEnergia')) != null) {
soluzionePrezzoEnergia = (await Backendless.Data.of('SoluzioniUtenze').find(Backendless.DataQueryBuilder.create().setWhereClause('utenza =\'Energia\'').setPageSize(10)))[0];
risparmioEnergia = (getObjectProperty(___arguments.context.pageData, 'prezzoEnergia')) * (getObjectProperty(___arguments.context.pageData, 'consumoEnergia')) - (getObjectProperty(soluzionePrezzoEnergia, 'prezzo')) * (getObjectProperty(___arguments.context.pageData, 'consumoEnergia'));
if (risparmioEnergia > 0) {
___arguments.context.pageData['risparmioEnergia'] = risparmioEnergia;
} else {
risparmioEnergia = 0;
___arguments.context.pageData['risparmioEnergia'] = 'Al momento hai un ottimo prezzo!';
}
}
if ((getObjectProperty(___arguments.context.pageData, 'prezzoGas')) != null) {
soluzionePrezzoGas = (await Backendless.Data.of('SoluzioniUtenze').find(Backendless.DataQueryBuilder.create().setWhereClause('utenza =\'Gas\'').setPageSize(10)))[0];
risparmioGas = (getObjectProperty(___arguments.context.pageData, 'prezzoGas')) * (getObjectProperty(___arguments.context.pageData, 'consumoGas')) - (getObjectProperty(soluzionePrezzoGas, 'prezzo')) * (getObjectProperty(___arguments.context.pageData, 'consumoGas'));
if (risparmioGas > 0) {
___arguments.context.pageData['risparmioGas'] = risparmioGas;
} else {
risparmioGas = 0;
___arguments.context.pageData['risparmioGas'] = 'Al momento hai un ottimo prezzo!';
}
}
if ((getObjectProperty(___arguments.context.pageData, 'prezzoInternet')) != null) {
soluzionePrezzoInternet = (await Backendless.Data.of('SoluzioniUtenze').find(Backendless.DataQueryBuilder.create().setWhereClause('utenza =\'Internet\'').setProperties('prezzo').setPageSize(10)))[0];
risparmioInternet = ((getObjectProperty(___arguments.context.pageData, 'prezzoInternet')) - (getObjectProperty(soluzionePrezzoInternet, 'prezzo'))) * 12;
if (risparmioInternet > 0) {
___arguments.context.pageData['risparmioInternet'] = risparmioInternet;
} else {
risparmioInternet = 0;
___arguments.context.pageData['risparmioInternet'] = 'Al momento hai un ottimo prezzo!';
}
}
___arguments.context.pageData['risparmioTotale'] = undefined;
},
/* handler:onClick */
/* content */
}))
*/ <---!!!!!!!!!!!!!!!!!!!!!!!!!!!!ERROR LINE!!!!!!!!!!!!!!!!!!!!!!!!!!!!
}))