File tree 2 files changed +27
-9
lines changed 2 files changed +27
-9
lines changed Original file line number Diff line number Diff line change @@ -126,14 +126,20 @@ export function generateNodesGraph(
126
126
return ;
127
127
}
128
128
129
- const nodeParameters =
130
- getNodeParameters (
131
- stickyType . description . properties ,
132
- stickyNote . parameters ,
133
- true ,
134
- false ,
135
- stickyNote ,
136
- ) ?? { } ;
129
+ let nodeParameters : IDataObject = { } ;
130
+
131
+ try {
132
+ nodeParameters =
133
+ getNodeParameters (
134
+ stickyType . description . properties ,
135
+ stickyNote . parameters ,
136
+ true ,
137
+ false ,
138
+ stickyNote ,
139
+ ) ?? { } ;
140
+ } catch {
141
+ // prevent node param resolution from failing graph generation
142
+ }
137
143
138
144
const height : number = typeof nodeParameters . height === 'number' ? nodeParameters . height : 0 ;
139
145
const width : number = typeof nodeParameters . width === 'number' ? nodeParameters . width : 0 ;
Original file line number Diff line number Diff line change @@ -5,8 +5,10 @@ import {
5
5
getDomainBase ,
6
6
getDomainPath ,
7
7
} from '@/TelemetryHelpers' ;
8
- import type { IWorkflowBase } from '@/index' ;
8
+ import { ApplicationError , STICKY_NODE_TYPE , type IWorkflowBase } from '@/index' ;
9
9
import { nodeTypes } from './ExpressionExtensions/Helpers' ;
10
+ import { mock } from 'jest-mock-extended' ;
11
+ import * as nodeHelpers from '@/NodeHelpers' ;
10
12
11
13
describe ( 'getDomainBase should return protocol plus domain' , ( ) => {
12
14
test ( 'in valid URLs' , ( ) => {
@@ -763,6 +765,16 @@ describe('generateNodesGraph', () => {
763
765
webhookNodeNames : [ ] ,
764
766
} ) ;
765
767
} ) ;
768
+
769
+ test ( 'should not fail on error to resolve a node parameter for sticky node type' , ( ) => {
770
+ const workflow = mock < IWorkflowBase > ( { nodes : [ { type : STICKY_NODE_TYPE } ] } ) ;
771
+
772
+ jest . spyOn ( nodeHelpers , 'getNodeParameters' ) . mockImplementationOnce ( ( ) => {
773
+ throw new ApplicationError ( 'Could not find property option' ) ;
774
+ } ) ;
775
+
776
+ expect ( ( ) => generateNodesGraph ( workflow , nodeTypes ) ) . not . toThrow ( ) ;
777
+ } ) ;
766
778
} ) ;
767
779
768
780
function validUrls ( idMaker : typeof alphanumericId | typeof email , char = CHAR ) {
You can’t perform that action at this time.
0 commit comments