Skip to content

Commit 5efaa93

Browse files
committed
fix typeError happening in tests
1 parent c4d1611 commit 5efaa93

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

x-pack/plugins/task_manager/task_manager.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,7 @@ export class TaskManager {
9898
this.isInitialized = true;
9999
})
100100
.catch((err: Error) => {
101+
// FIXME: check the type of error to make sure it's actually an ES error
101102
logger.warning(err.message);
102103

103104
// rety again to initialize store and poller, using the timing of

x-pack/plugins/task_manager/task_store.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,8 @@ export class TaskStore {
133133
filter_path: '*.version',
134134
});
135135
// extract the existing version
136-
existingVersion = templateCheck[templateName].version || 0;
136+
const template = templateCheck[templateName] || {};
137+
existingVersion = template.version || 0;
137138
} catch (err) {
138139
if (err.statusCode !== 404) {
139140
throw err; // ignore not found

0 commit comments

Comments
 (0)