Skip to content

Commit

Permalink
Prevent error reported in #11028
Browse files Browse the repository at this point in the history
  • Loading branch information
mattab committed Dec 18, 2016
1 parent dae9b48 commit 0e3cf32
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion plugins/CoreHome/javascripts/dataTable.js
Expand Up @@ -509,7 +509,9 @@ $.extend(DataTable.prototype, UIControl.prototype, {

setMaxTableWidthIfNeeded(domElem, 1200);

var isTableVisualization = this.jsViewDataTable && this.jsViewDataTable.indexOf('table') !== -1;
var isTableVisualization = this.jsViewDataTable
&& typeof this.jsViewDataTable.indexOf === 'function'
&& this.jsViewDataTable.indexOf('table') !== -1;
if (isTableVisualization) {
// we do this only for html tables

Expand Down

1 comment on commit 0e3cf32

@tsteur
Copy link
Member

@tsteur tsteur commented on 0e3cf32 Dec 18, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ideally we would find the cause for that as it hides the actual error now. FYI: I'd also add a typeof this.jsViewDataTable === 'object'. If jsViewDataTable is not set, it may result in an error

Please sign in to comment.