From 19e2b4932506de11849830fded149ced0d7a513b Mon Sep 17 00:00:00 2001 From: Ralf Becker Date: Fri, 22 Aug 2014 12:32:49 +0000 Subject: [PATCH] Check if content is there before trying to look inside it. Fixes "TypeError: Cannot read property id of null" from mail dialog --- etemplate/js/et2_widget_grid.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/etemplate/js/et2_widget_grid.js b/etemplate/js/et2_widget_grid.js index d400851af8..67c1dc002d 100644 --- a/etemplate/js/et2_widget_grid.js +++ b/etemplate/js/et2_widget_grid.js @@ -926,8 +926,13 @@ var et2_grid = et2_DOMWidget.extend([et2_IDetachedDOM, et2_IAligned], // Add a new action object to the object manager var row = $j('tr', this.tbody)[i]; var aoi = new et2_action_object_impl(this, row); + var id = "row_"+i; var content = this.getArrayMgr('content').getEntry(i); - var obj = widget_object.addObject(content.id || "row_"+i, aoi); + if(content && content.id) + { + id = content.id; + } + var obj = widget_object.addObject(id, aoi); // Set the data to the content so it's available for the action if(content)