Skip to content

Commit

Permalink
Merge pull request alexed1#1427 from mykah89/bug-fix/email-attachment…
Browse files Browse the repository at this point in the history
…-versioning

Compare ContentVersions VersionNumbers as Numbers alexed1#1425
  • Loading branch information
alexed1 authored Jul 10, 2023
2 parents fc0082a + 01f1d9f commit 5f83068
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,8 @@ public inherited sharing class SendBetterEmailUtil {
ContentVersion lastFound = mapContentDocumentIdByContentVersion.get(
cv.ContentDocumentId
)[0];
if (lastFound.VersionNumber < cv.VersionNumber) {
if (lastFound.VersionNumber.isNumeric() && cv.VersionNumber.isNumeric() ? Decimal.valueOf(lastFound.VersionNumber) < Decimal.valueOf(cv.VersionNumber)
: lastFound.VersionNumber < cv.VersionNumber) {
mapContentDocumentIdByContentVersion.get(cv.ContentDocumentId)[0] = cv;
}
}
Expand Down

0 comments on commit 5f83068

Please sign in to comment.