fix: crashea cuando el log no tiene changedModel
gitea/salix/pipeline/head There was a failure building this commit Details

This commit is contained in:
Vicent Llopis 2022-11-28 14:47:23 +01:00
parent 2eabe38277
commit c3d06ca5db
1 changed files with 3 additions and 2 deletions

View File

@ -34,10 +34,11 @@ export default class Controller extends Section {
set logs(value) {
this._logs = value;
if (!value) return;
console.log(value);
const validations = window.validations;
value.forEach(log => {
const locale = validations[log.changedModel].locale ? validations[log.changedModel].locale : {};
console.log(log.changedModel);
const locale = validations[log.changedModel] && validations[log.changedModel].locale ? validations[log.changedModel].locale : {};
log.oldProperties = this.getInstance(log.oldInstance, locale);
log.newProperties = this.getInstance(log.newInstance, locale);