@@ -27,7 +27,7 @@ export class MissingNullHandler extends AdvancedRule implements core.IRuleDefini
2727 for ( const getElement of getOperationElements ) {
2828 const elementName = getElement . name ;
2929 let nullCheckFound = false ;
30- let resultReferences = [ ] ;
30+ let resultReferences : string [ ] = [ ] ;
3131 if ( getElement . element [ "storeOutputAutomatically" ] ) {
3232 resultReferences = [ elementName ] ;
3333 } else if ( getElement . element [ "outputReference" ] ) {
@@ -39,9 +39,18 @@ export class MissingNullHandler extends AdvancedRule implements core.IRuleDefini
3939 }
4040 }
4141 for ( const el of decisionElements ) {
42- const rules = el . element [ "rules" ] ;
42+ let rules = el . element [ "rules" ] ;
43+ const isRuleAnArray = Array . isArray ( rules ) ;
44+ if ( ! isRuleAnArray ) {
45+ rules = [ rules ] ;
46+ }
4347 for ( const rule of rules ) {
44- for ( const condition of rule . conditions ) {
48+ let conditions = rule . conditions ;
49+ const isConditionsAnArray = Array . isArray ( conditions ) ;
50+ if ( ! isConditionsAnArray ) {
51+ conditions = [ conditions ] ;
52+ }
53+ for ( const condition of conditions ) {
4554 let referenceFound : boolean = false ;
4655 let isNullOperator : boolean = false ;
4756 let checksIfFalse : boolean = false ;
@@ -54,15 +63,19 @@ export class MissingNullHandler extends AdvancedRule implements core.IRuleDefini
5463 }
5564 }
5665 }
57- if ( condition . operator && condition . operator . length > 0 ) {
66+ if (
67+ condition . operator &&
68+ ( ! Array . isArray ( condition . operator ) || condition . operator . length > 0 )
69+ ) {
5870 const operator = condition . operator ;
5971 isNullOperator = operator === "IsNull" ;
6072 }
6173 if (
6274 condition . rightValue &&
63- condition . rightValue . length > 0 &&
75+ ( ! Array . isArray ( condition . rightValue ) || condition . rightValue . length > 0 ) &&
6476 condition . rightValue . booleanValue &&
65- condition . rightValue . booleanValue . length > 0
77+ ( ! Array . isArray ( condition . rightValue . booleanValue ) ||
78+ condition . rightValue . booleanValue . length > 0 )
6679 ) {
6780 const rightValue = condition . rightValue . booleanValue ;
6881 checksIfFalse = rightValue . toLowerCase ( ) === "false" ;
0 commit comments