Skip to content

Commit

Permalink
Even safer
Browse files Browse the repository at this point in the history
  • Loading branch information
jamessimone committed Mar 11, 2021
1 parent b0d0ea9 commit d390836
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions rollup/main/default/classes/RollupCalculator.cls
Original file line number Diff line number Diff line change
Expand Up @@ -679,11 +679,12 @@ public without sharing abstract class RollupCalculator {
}

protected override void setReturnValue() {
String trimmedDelimiter = this.concatDelimiter.trim();
String possibleReturnValue = this.stringVal.normalizeSpace();
String withoutEndingComma = possibleReturnValue.endsWith(this.concatDelimiter)
? possibleReturnValue.substringBeforeLast(this.concatDelimiter)
String withoutEndingComma = possibleReturnValue.endsWith(trimmedDelimiter)
? possibleReturnValue.substringBeforeLast(trimmedDelimiter)
: possibleReturnValue;
this.returnVal = (withoutEndingComma.startsWith(this.concatDelimiter) ? withoutEndingComma.substring(1, withoutEndingComma.length()) : withoutEndingComma)
this.returnVal = (withoutEndingComma.startsWith(trimmedDelimiter) ? withoutEndingComma.substring(1, withoutEndingComma.length()) : withoutEndingComma)
.trim();
}

Expand Down

0 comments on commit d390836

Please sign in to comment.