Skip to content

Commit 8b5a16e

Browse files
authored
Fix dml rule bug (#87)
* rm js2xml traversal logic
1 parent e9f6a16 commit 8b5a16e

File tree

4 files changed

+9
-9
lines changed

4 files changed

+9
-9
lines changed

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "lightning-flow-scanner-core",
3-
"version": "3.12.0",
3+
"version": "3.16.0",
44
"main": "out/**",
55
"types": "index.d.ts",
66
"scripts": {

src/main/rules/DMLStatementInLoop.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,8 @@ export class DMLStatementInLoop extends RuleCommon implements core.IRuleDefiniti
3030
for (const element of loopElements) {
3131
let loopEnd: string | undefined;
3232
// Check if 'noMoreValuesConnector' attribute exists
33-
if (element.element['noMoreValuesConnector'] && element.element['noMoreValuesConnector'][0]) {
34-
loopEnd = element.element['noMoreValuesConnector'][0].targetReference[0];
33+
if (element.element['noMoreValuesConnector'] && element.element['noMoreValuesConnector']) {
34+
loopEnd = element.element['noMoreValuesConnector'].targetReference;
3535
} else {
3636
loopEnd = element.name;
3737
}

src/main/rules/MissingNullHandler.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ export class MissingNullHandler extends RuleCommon implements core.IRuleDefiniti
4343
let isNullOperator: boolean = false;
4444
let checksIfFalse: boolean = false;
4545
if (condition.leftValueReference && condition.leftValueReference.length > 0) {
46-
let valueReference = condition.leftValueReference[0];
46+
let valueReference = condition.leftValueReference;
4747
for(let ref of resultReferences){
4848
referenceFound = ref.includes(valueReference);
4949
if(referenceFound){
@@ -52,11 +52,11 @@ export class MissingNullHandler extends RuleCommon implements core.IRuleDefiniti
5252
}
5353
}
5454
if (condition.operator && condition.operator.length > 0) {
55-
let operator = condition.operator[0];
55+
let operator = condition.operator;
5656
isNullOperator = (operator === 'IsNull');
5757
}
58-
if (condition.rightValue && condition.rightValue.length > 0 && condition.rightValue[0].booleanValue && condition.rightValue[0].booleanValue.length > 0) {
59-
let rightValue = condition.rightValue[0].booleanValue[0];
58+
if (condition.rightValue && condition.rightValue.length > 0 && condition.rightValue.booleanValue && condition.rightValue.booleanValue.length > 0) {
59+
let rightValue = condition.rightValue.booleanValue;
6060
checksIfFalse = (rightValue.toLowerCase() === 'false');
6161
}
6262
if (referenceFound && isNullOperator && checksIfFalse) {

0 commit comments

Comments
 (0)