Skip to content

Commit edda587

Browse files
committed
fixing build
1 parent b550db6 commit edda587

1 file changed

Lines changed: 8 additions & 5 deletions

File tree

  • src/platform/plugins/shared/workflows_management/public/widgets/workflow_yaml_editor/lib/snippets

src/platform/plugins/shared/workflows_management/public/widgets/workflow_yaml_editor/lib/snippets/insert_step_snippet.ts

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -84,11 +84,14 @@ function findStepWithMaxEndOffsetAtOrBefore(
8484
let bestEndOffset = -1;
8585
for (const node of nodes) {
8686
const range = getMonacoRangeFromYamlNode(model, node);
87-
if (!range) continue;
88-
const endOffset = model.getOffsetAt(new monaco.Position(range.endLineNumber, range.endColumn));
89-
if (endOffset <= cursorOffset && endOffset > bestEndOffset) {
90-
bestEndOffset = endOffset;
91-
best = node;
87+
if (range) {
88+
const endOffset = model.getOffsetAt(
89+
new monaco.Position(range.endLineNumber, range.endColumn)
90+
);
91+
if (endOffset <= cursorOffset && endOffset > bestEndOffset) {
92+
bestEndOffset = endOffset;
93+
best = node;
94+
}
9295
}
9396
}
9497
return best;

0 commit comments

Comments
 (0)