Fix error Cannot read properties of null (reading 'split')

This commit is contained in:
Hadi Nategh 2021-12-16 11:39:43 +01:00
parent f6a7a63feb
commit 170ac4d6e2

View File

@ -1073,8 +1073,8 @@ export class etemplate2
// check if id contains a hierachical name, eg. "button[save]"
let id = _widget.id;
let indexes = id.split('[');
if(indexes.length > 1)
let indexes = id?.split('[');
if(indexes?.length > 1)
{
indexes = [indexes.shift(), indexes.join('[')];
indexes[1] = indexes[1].substring(0, indexes[1].length - 1);