Skip to content

Commit 70065ba

Browse files
committed
RPC version check before setting crc
1 parent 38bdf60 commit 70065ba

1 file changed

Lines changed: 7 additions & 4 deletions

File tree

lib/js/src/manager/file/FileManager.js

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -78,10 +78,13 @@ class FileManager extends _FileManagerBase {
7878
putFile.setFileType(file.getType());
7979
}
8080

81-
// set the crc value if putfile data exists
82-
if (putFile.getFileData() !== null && putFile.getFileData() !== undefined) {
83-
// use the file data to generate a crc32 checksum from it
84-
putFile.setCrc(_FileUtils.createCrc(putFile.getFileData()));
81+
// putfile crc introduced in 5.0.0
82+
if (this._lifecycleManager.getSdlMsgVersion().getMajorVersion() >= 5) {
83+
// set the crc value if putfile data exists
84+
if (putFile.getFileData() !== null && putFile.getFileData() !== undefined) {
85+
// use the file data to generate a crc32 checksum from it
86+
putFile.setCrc(_FileUtils.createCrc(putFile.getFileData()));
87+
}
8588
}
8689

8790
putFile.setPersistentFile(file.isPersistent());

0 commit comments

Comments
 (0)