Skip to content

Commit

Permalink
fix Error in LogTrackItemJob: TypeError: Cannot read properties of un…
Browse files Browse the repository at this point in the history
…defined (reading 'id')
  • Loading branch information
MayGo committed Jul 20, 2023
1 parent ebc605d commit 502e7db
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion electron/src/jobs/log-track-item-job.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,10 +75,11 @@ export class LogTrackItemJob {

let savedItem = await backgroundService.createOrUpdate(rawItem);
// at midnight track item is split and new items ID should be RUNNING_LOG_ITEM
if (savedItem.id !== logItemMarkedAsRunning.id) {
if (savedItem && savedItem.id !== logItemMarkedAsRunning?.id) {
logger.debug('RUNNING_LOG_ITEM changed.');
await stateManager.setLogTrackItemMarkedAsRunning(savedItem);
}

return savedItem;
}

Expand Down

0 comments on commit 502e7db

Please sign in to comment.