From b520458342ce02b7cdb2851e66337a40e39a5d83 Mon Sep 17 00:00:00 2001 From: Walter Rafelsberger Date: Thu, 28 Nov 2019 15:23:42 +0100 Subject: [PATCH] [ML] Fix getViewBySwimlaneOptions() when no jobs are present. --- .../plugins/ml/public/application/explorer/explorer_utils.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/x-pack/legacy/plugins/ml/public/application/explorer/explorer_utils.js b/x-pack/legacy/plugins/ml/public/application/explorer/explorer_utils.js index 936926e02ef7d..38b088eed9b81 100644 --- a/x-pack/legacy/plugins/ml/public/application/explorer/explorer_utils.js +++ b/x-pack/legacy/plugins/ml/public/application/explorer/explorer_utils.js @@ -327,7 +327,7 @@ export function getViewBySwimlaneOptions({ if (selectedJobIds.length > 1) { // If more than one job selected, default to job ID. viewBySwimlaneFieldName = VIEW_BY_JOB_LABEL; - } else { + } else if (mlJobService.jobs.length > 0) { // For a single job, default to the first partition, over, // by or influencer field of the first selected job. const firstSelectedJob = mlJobService.jobs.find((job) => {