From 170ac4d6e2e08028cebd9404e23c893f8e28cc01 Mon Sep 17 00:00:00 2001 From: Hadi Nategh Date: Thu, 16 Dec 2021 11:39:43 +0100 Subject: [PATCH] Fix error Cannot read properties of null (reading 'split') --- api/js/etemplate/etemplate2.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/api/js/etemplate/etemplate2.ts b/api/js/etemplate/etemplate2.ts index e6353f3abb..b2224a20f9 100644 --- a/api/js/etemplate/etemplate2.ts +++ b/api/js/etemplate/etemplate2.ts @@ -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);