Fix crash when cancelling pending tasks (#2527)

This commit is contained in:
InfiniteTF 2022-04-25 08:21:21 +02:00 committed by GitHub
parent 1b91937004
commit 0c2dc17e8e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 1 deletions

View file

@ -151,8 +151,13 @@ func initJobManager() *job.Manager {
case j := <-c.RemovedJob:
if instance.Config.GetNotificationsEnabled() {
cleanDesc := strings.TrimRight(j.Description, ".")
timeElapsed := j.EndTime.Sub(*j.StartTime)
if j.StartTime == nil {
// Task was never started
return
}
timeElapsed := j.EndTime.Sub(*j.StartTime)
desktop.SendNotification("Task Finished", "Task \""+cleanDesc+"\" is finished in "+formatDuration(timeElapsed)+".")
}
case <-ctx.Done():

View file

@ -1,4 +1,5 @@
### 🐛 Bug fixes
* Fix crash when cancelling pending tasks. ([#2527](https://github.com/stashapp/stash/pull/2527))
* Fix markers not refreshing after creating new marker. ([#2502](https://github.com/stashapp/stash/pull/2502))
* Fix error when submitting scene draft to stash-box without performers. ([#2515](https://github.com/stashapp/stash/pull/2515))
* Fix incorrect video player positioning on touch-enabled devices. ([#2501](https://github.com/stashapp/stash/issues/2501))