Skip to content

Commit

Permalink
SFDC's getDonationsTotal must return 0.0 when the sum is null
Browse files Browse the repository at this point in the history
  • Loading branch information
brmeyer committed Aug 5, 2024
1 parent 7c7847a commit 880880f
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -1096,7 +1096,11 @@ public double getDonationsTotal(String filter) throws Exception {
}

SObject result = sfdcClient.querySingle("SELECT SUM(Amount) TotalAmount FROM Opportunity WHERE StageName='Closed Won' AND " + filter).get();
return (Double) result.getField("TotalAmount");
Object totalAmount = result.getField("TotalAmount");
if (totalAmount == null) {
return 0.0;
}
return (Double) totalAmount;
}

@Override
Expand Down

0 comments on commit 880880f

Please sign in to comment.