Open thesunlover opened 6 months ago
@thesunlover , the link you provided isn't working. Can you provide sample code? What's happening at line 79 of UserSettingsDTO
?
Hey @jfeingold35, thank you!
Here is the helper function containing the code around line 79 of UserSettingsDTO
:
/**
* @description Setup Features
* @param userId Id of the User
*/
private void setupFeatures(Id userId) {
this.features.add(Constants.BASIC_FEATURE_TYPE);
Features__c settings = Features__c.getInstance(userId);
Features__c defaults = Features__c.getOrgDefaults();
Object feature1 = settings.get('Enable_Feature1__c'); // checkbox field
if (feature1 == null) {
feature1 = defaults.get('Enable_Feature1__c');
}
if (feature1 != null && (Boolean)feature1) {
this.features.add(Constants.FEATURE1_TYPE);
}
Object feature2 = settings.get('Enable_Feature2__c'); // checkbox field
if (feature2 == null) {
feature2 = defaults.get('Enable_Feature2__c');
}
if (feature2 != null && (Boolean)feature2) { //line 79
this.features.add(Constants.FEATURE2_TYPE);
}
}
scanner run dfa
Issue TemplateFill out this template to submit your Code Analyzer issue.
Description:
Documentation:
Steps To Reproduce:
I'm running the
sfdx scanner:run:dfa
for this commit and I get the following in the sfge.log:Expected Behavior:
Give a meaningful error in the output. Screenshots:
Desktop:
Additional Context:
Workaround:
N/A
Urgency:
It is for a 2GP managed package.