Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,11 @@ function getUniqueLayerCounts(layerCountsList, mapsCount) {
}

function getIndexPatternsWithGeoFieldCount(indexPatterns) {
const fieldLists = indexPatterns.map(indexPattern => JSON.parse(indexPattern.attributes.fields));
const fieldLists = indexPatterns.map(indexPattern =>
indexPattern.attributes && indexPattern.attributes.fields
? JSON.parse(indexPattern.attributes.fields)
: []
);
const fieldListsWithGeoFields = fieldLists.filter(fields => {
return fields.some(
field =>
Expand All @@ -50,7 +54,9 @@ function getIndexPatternsWithGeoFieldCount(indexPatterns) {

export function buildMapsTelemetry({ mapSavedObjects, indexPatternSavedObjects, settings }) {
const layerLists = mapSavedObjects.map(savedMapObject =>
JSON.parse(savedMapObject.attributes.layerListJSON)
savedMapObject.attributes && savedMapObject.attributes.layerListJSON
? JSON.parse(savedMapObject.attributes.layerListJSON)
: []
);
const mapsCount = layerLists.length;

Expand Down