Skip to content

Commit 5893d07

Browse files
Merge pull request #814 from learner-enthusiast/SPRW-2055-delete-hub-profile-picture-is-not-working
fix:SPRW-2055 Delete hub profile picture is not working
2 parents cab82a0 + 5f0ac4e commit 5893d07

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

src/modules/identity/services/team.service.ts

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -360,12 +360,16 @@ export class TeamService {
360360

361361
let team;
362362
if (image) {
363-
if (!isImageBuffer(image.buffer)) {
364-
throw new BadRequestException("Uploaded file is not a valid image");
363+
if (image.size > 0) {
364+
if (!isImageBuffer(image.buffer)) {
365+
throw new BadRequestException("Uploaded file is not a valid image");
366+
}
365367
}
366368
await this.isImageSizeValid(image.size);
367369
const dataBuffer = image.buffer;
368-
await this.isImageDimensionValid(dataBuffer);
370+
if (image.size > 0) {
371+
await this.isImageDimensionValid(dataBuffer);
372+
}
369373
const dataString = dataBuffer.toString("base64");
370374
const logo = {
371375
bufferString: dataString,

0 commit comments

Comments
 (0)