[metastore] Check for additional nullpointers on HueDataTable
self.fnSearch = function (what, avoidScroll) {
var $t = self.$table;
+ if ($t) {
if (typeof avoidScroll === 'undefined' || !avoidScroll) {
$t.find('.columnSelected').removeClass('columnSelected');
$t.data('scrollToCol', null);
$('.hue-datatable-search').find('span').text($t.data('oInit')['i18n'].NO_RESULTS);
}
}
+ }
};
self.fnScrollToPreviousResult = function () {
var $t = self.$table;
- if ($t.data('searchCoords').length > 0) {
+ if ($t && $t.data('searchCoords') && $t.data('searchCoords').length > 0) {
var high = $t.data('searchCoordHighlighted');
high = high == 0 ? $t.data('searchCoords').length - 1 : high - 1;
$t.data('searchCoordHighlighted', high);
self.fnScrollToNextResult = function () {
var $t = self.$table;
- if ($t.data('searchCoords').length > 0) {
+ if ($t && $t.data('searchCoords') && $t.data('searchCoords').length > 0) {
var high = $t.data('searchCoordHighlighted');
high = high == $t.data('searchCoords').length - 1 ? 0 : high + 1;
$t.data('searchCoordHighlighted', high);
self.isScrolling = false;
self.fnScrollTo = function (row, col) {
- self.isScrolling = true;
var $t = self.$table;
+ if ($t) {
+ self.isScrolling = true;
$('.hue-datatable-search').find('span').text(($t.data('searchCoordHighlighted') + 1) + ' ' + $t.data('oInit')['i18n'].OF + ' ' + $t.data('searchCoords').length);
var colSel = $t.find("tr th:nth-child(" + (col + 1) + ")");
$t.parent().animate({
$t.parent().trigger('scroll');
});
}
+ }
self.isDrawing = false;
self.fnDraw = function (force) {
var aoColumns = self.$table.data('aoColumns');
if (!self.isDrawing && aoColumns) {
- self.isDrawing = true;
var $t = self.$table;
+ if ($t) {
+ self.isDrawing = true;
var data = self.$table.data('data');
var appendable = $t.children('tbody').length > 0 ? $t.children('tbody') : $t;
var startCol = -1;
self.isDrawing = false;
}
+ }
};
self.fnAddData = function (mData, bRedraw) {
self.fnClearTable = function (bRedraw) {
var $t = self.$table;
+ if ($t) {
if ($t.children('tbody').length > 0) {
$t.children('tbody').empty();
}
$t.data('aoRows', []);
$t.data('aoColumns', []);
$t.data('fnDraws', 0);
+ }
};
self.fnDestroy = function () {
