Skip to content

Commit

Permalink
Ensure pipeline wrapper can be created in validations
Browse files Browse the repository at this point in the history
  • Loading branch information
georg-schwarz committed Jan 12, 2024
1 parent 32c87d9 commit cda9e9a
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,10 @@ function checkPipesOfBlock(
whatToCheck: 'input' | 'output',
context: ValidationContext,
): void {
if (!BlockTypeWrapper.canBeWrapped(block?.type)) {
if (
!BlockTypeWrapper.canBeWrapped(block?.type) ||
!PipelineWrapper.canBeWrapped(block.$container)
) {
return;
}
const blockType = new BlockTypeWrapper(block?.type);
Expand Down Expand Up @@ -98,6 +101,7 @@ function collectPipes(
whatToCheck: 'input' | 'output',
): PipeWrapper[] {
const pipelineWrapper = new PipelineWrapper(block.$container);

let pipes: PipeWrapper[];
switch (whatToCheck) {
case 'input': {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,11 @@ function checkStartingBlocks(
pipeline: PipelineDefinition,
context: ValidationContext,
): void {
if (PipelineWrapper.canBeWrapped(pipeline)) {
return;
}
const pipelineWrapper = new PipelineWrapper(pipeline);

const startingBlocks = pipelineWrapper.getStartingBlocks();
if (startingBlocks.length === 0) {
context.accept(
Expand Down

0 comments on commit cda9e9a

Please sign in to comment.