From 12c79a0e65bd8e768209c5bc7104287bd4175abb Mon Sep 17 00:00:00 2001 From: Mark McEver Date: Tue, 7 Aug 2018 14:40:04 -0500 Subject: [PATCH] Display a more relevant error when no column headers are present --- js/core/core.constructor.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/js/core/core.constructor.js b/js/core/core.constructor.js index 30e9f0c91..e3625ada3 100644 --- a/js/core/core.constructor.js +++ b/js/core/core.constructor.js @@ -270,6 +270,11 @@ else aoColumnsInit = oInit.aoColumns; } +if ( aoColumnsInit.length === 0 ) +{ + throw new Error("The table must contain a element with at least one column."); +} + /* Add the columns */ for ( i=0, iLen=aoColumnsInit.length ; i