* guard against empty and undefined index pattern arrays * fix merge issues
This commit is contained in:
parent
6f864e282a
commit
01dc301d6f
|
@ -19,7 +19,7 @@
|
|||
|
||||
import { IndexPattern } from 'ui/index_patterns';
|
||||
|
||||
import { debounce, isEqual } from 'lodash';
|
||||
import { compact, debounce, isEqual } from 'lodash';
|
||||
import React, { Component } from 'react';
|
||||
import { getFromLegacyIndexPattern } from 'ui/index_patterns/static_utils';
|
||||
import { kfetch } from 'ui/kfetch';
|
||||
|
@ -184,7 +184,11 @@ export class QueryBar extends Component<Props, State> {
|
|||
const recentSearchSuggestions = this.getRecentSearchSuggestions(query);
|
||||
|
||||
const autocompleteProvider = getAutocompleteProvider(language);
|
||||
if (!autocompleteProvider) {
|
||||
if (
|
||||
!autocompleteProvider ||
|
||||
!Array.isArray(this.props.indexPatterns) ||
|
||||
compact(this.props.indexPatterns).length === 0
|
||||
) {
|
||||
return recentSearchSuggestions;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue