[SQL Lab] Fix bug when filtering on results that include nulls (#8231)

This commit is contained in:
Erik Ritter 2019-09-16 21:05:58 -07:00 committed by Maxime Beauchemin
parent bf7ce62166
commit 1ad17936ba
2 changed files with 3 additions and 2 deletions

View File

@ -26,6 +26,7 @@ describe('FilterableTable', () => {
data: [
{ a: 'a1', b: 'b1', c: 'c1', d: 0 },
{ a: 'a2', b: 'b2', c: 'c2', d: 100 },
{ a: null, b: 'b3', c: 'c3', d: 50 },
],
height: 500,
};
@ -38,7 +39,7 @@ describe('FilterableTable', () => {
});
it('renders a grid with 2 Table rows', () => {
expect(wrapper.find('.ReactVirtualized__Grid')).toHaveLength(1);
expect(wrapper.find('.ReactVirtualized__Table__row')).toHaveLength(2);
expect(wrapper.find('.ReactVirtualized__Table__row')).toHaveLength(3);
});
it('renders a grid with 2 Grid rows for wide tables', () => {
const wideTableColumns = MAX_COLUMNS_FOR_TABLE + 1;

View File

@ -223,7 +223,7 @@ export default class FilterableTable extends PureComponent {
const cellValue = row[key];
if (typeof cellValue === 'string') {
values.push(cellValue.toLowerCase());
} else if (typeof cellValue.toString === 'function') {
} else if (cellValue !== null && typeof cellValue.toString === 'function') {
values.push(cellValue.toString());
}
}