diff --git a/framework/services/debit.service.js b/framework/services/debit.service.js index a568d3b..10a76a8 100644 --- a/framework/services/debit.service.js +++ b/framework/services/debit.service.js @@ -37,7 +37,9 @@ module.exports = { delete res[i].id; if(typeof ctx.params.jwt == 'undefined') { delete res[i].jwt; - delete res[i].finalReading.clearingJWT; + if(typeof res[i].finalReading !== 'undefined') { + delete res[i].finalReading.clearingJWT; + } } } if((typeof ctx.params.format !== 'undefined') && (ctx.params.format == 'csv')) {