Skip to content

Commit

Permalink
chore: fix missing variable
Browse files Browse the repository at this point in the history
  • Loading branch information
sebbi08 committed May 2, 2024
1 parent c665ec2 commit c6fc22b
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions server/src/services/asset.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -326,13 +326,13 @@ export class AssetService {
const asset = await this.assetRepository.getById(id);
const oldCreatedAtDate = asset?.fileCreatedAt && DateTime.fromJSDate(asset.fileCreatedAt);
let newDateTimeString = dateTimeOriginal;
if (dateTimeOriginal && keepTimeUnchanged && oldDateTime) {
if (dateTimeOriginal && keepTimeUnchanged && oldCreatedAtDate) {
let newDateTime = DateTime.fromISO(dateTimeOriginal);

newDateTime = newDateTime.set({
hour: oldDateTime.hour,
minute: oldDateTime?.minute,
second: oldDateTime.second,
hour: oldCreatedAtDate.hour,
minute: oldCreatedAtDate?.minute,
second: oldCreatedAtDate.second,
});
const newDateTimeStringWithNull = newDateTime?.toISO();
newDateTimeString = newDateTimeStringWithNull === null ? undefined : newDateTimeStringWithNull;
Expand Down

0 comments on commit c6fc22b

Please sign in to comment.