mirror of
https://github.com/elastic/kibana.git
synced 2025-04-23 17:28:26 -04:00
This commit is contained in:
parent
d6e89c2a26
commit
2fe8267992
1 changed files with 2 additions and 2 deletions
|
@ -124,7 +124,7 @@ export const splitSizeAndUnits = field => {
|
|||
|
||||
export const isNumber = value => typeof value === 'number';
|
||||
export const isEmptyObject = (obj) => {
|
||||
return Object.entries(obj).length === 0 && obj.constructor === Object;
|
||||
return !obj || (Object.entries(obj).length === 0 && obj.constructor === Object);
|
||||
};
|
||||
|
||||
export const phaseFromES = (phase, phaseName, defaultEmptyPolicy) => {
|
||||
|
@ -275,7 +275,7 @@ export const phaseToES = (phase, originalEsPhase) => {
|
|||
}
|
||||
if (esPhase.actions.allocate
|
||||
&& !esPhase.actions.allocate.require
|
||||
&& !esPhase.actions.allocate.number_of_replicas
|
||||
&& !isNumber(esPhase.actions.allocate.number_of_replicas)
|
||||
&& isEmptyObject(esPhase.actions.allocate.include)
|
||||
&& isEmptyObject(esPhase.actions.allocate.exclude)
|
||||
) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue