Skip to content

Commit 94ff1ca

Browse files
committed
Fix cloning method params for file types
1 parent 33bbf1c commit 94ff1ca

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

lib/js/src/manager/file/filetypes/SdlArtwork.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -126,9 +126,9 @@ class SdlArtwork extends SdlFile {
126126
const clonedParams = Object.assign({}, this); // shallow copy
127127

128128
if (clonedParams._imageRPC !== null) {
129-
clonedParams._imageRPC = Object.assign(new SdlArtwork(), clonedParams._artwork);
129+
clonedParams._imageRPC = Object.assign(new Image(), clonedParams._imageRPC);
130130
}
131-
return Object.assign(new SdlArtwork(this.getName(), this.getType(), this.getFileData(), this.isPersistent()), clonedParams);
131+
return Object.assign(new SdlArtwork(), clonedParams);
132132
}
133133
}
134134

lib/js/src/manager/file/filetypes/SdlFile.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -223,10 +223,10 @@ class SdlFile {
223223
clone () {
224224
const clonedParams = Object.assign({}, this); // shallow copy
225225

226-
if (this.getFileData() !== null && this.getFileData() !== undefined) {
227-
return Object.assign(new SdlFile(this.getName(), this.getType(), Uint8Array.from(this.getFileData()), this.isPersistent()), clonedParams);
226+
if (clonedParams._fileData !== null && clonedParams._fileData !== undefined) {
227+
clonedParams._fileData = Uint8Array.from(clonedParams._fileData);
228228
}
229-
return Object.assign(new SdlFile(this.getName(), this.getType(), this.getFileData(), this.isPersistent()), clonedParams);
229+
return Object.assign(new SdlFile(), clonedParams);
230230
}
231231
}
232232

0 commit comments

Comments
 (0)