Closed micharozen closed 13 hours ago
@micharozen , the error message is talking about a string.toLowerCase()
call and an ObjectFieldInfo.getObjectName()
call, and those aren't visible in the code you posted. Without seeing those, this looks like what's happening is that string.toLwoercase()
is being called on a null value. Is it possible for you to identify that line?
Duplicate of #1497
Have you tried to resolve this issue yourself first?
Yes
Bug Description
Error Message:
Graph Engine identified your source and sink, but you must manually verify that you have a sanitizer in this path. Then, add an engine directive to skip the path. Next, create a Github issue for the Code Analyzer team that includes the error and stack trace. After we fix this issue, check the Code Analyzer release notes for more info. Error and stacktrace: NullPointerException: Cannot invoke "String.toLowerCase(java.util.Locale)" because the return value of "com.salesforce.rules.fls.apex.operations.ObjectFieldInfo.getObjectName()" is null: com.salesforce.graph.ops.ObjectFieldUtil.regroupByObject(ObjectFieldUtil.java:26);com.salesforce.rules.fls.apex.operations.FlsViolationMessageUtil.consolidateFlsViolations(FlsViolationMessageUtil.java:54);com.salesforce.rules.PathBasedRuleRunner.convertFlsInfoToViolations(PathBasedRuleRunner.java:215);com.salesforce.rules.PathBasedRuleRunner.executeRulesOnPaths(PathBasedRuleRunner.java:189);com.salesforce.rules.PathBasedRuleRunner.runRules(PathBasedRuleRunner.java:88);com.salesforce.rules.ThreadableRuleExecutor$CallableExecutor.runRules(ThreadableRuleExecutor.java:228)
Code:
`global void execute(Database.BatchableContext BC, List scope) {
// Vérifier les permissions FLS pour Task
if(!PermissionUtils.checkFieldAccessibility('Task', new String[]{
'Subject', 'Description', 'Status', 'ActivityDate', 'WhatId', 'Type', 'OwnerId'
})) {
throw new SecurityException('Insufficient permissions to access Task fields');
}
Output / Logs
No response
Steps To Reproduce
1.Have this bloc in sf project
sf scanner run dfa --format csv --outfile CodeAnalyzerDFA.csv --target ./ --projectdir ./ --category Security
Expected Behavior
I expect no flag detected in this bloc
Operating System
MacOS SOnoma 14.6.1
Salesforce CLI Version
@salesforce/cli/2.48.6 darwin-arm64 node-v20.15.0
Code Analyzer Plugin (@salesforce/sfdx-scanner) Version
@salesforce/sfdx-scanner 4.3.0
Java Version
java version "17.0.5" 2022-10-18 LTS
Additional Context (Screenshots, Files, etc)
No response
Workaround
No response
Urgency
Moderate