[PR #883] [MERGED] Fix exception when pressing cancel while inserting frames is ongoing #1244

Closed
opened 2026-02-26 09:34:09 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/NickeManarin/ScreenToGif/pull/883
Author: @pawlos
Created: 5/7/2021
Status: Merged
Merged: 5/8/2021
Merged by: @NickeManarin

Base: bugfix/883-Exception-when-cancelling-image-importHead: exception-when-closing-starter-insert-task


📝 Commits (2)

  • 92ade86 Merge branch 'dev'
  • 3a4aa57 Fix exception when pressing cancel while inserting frames is ongoing

📊 Changes

1 file changed (+1 additions, -1 deletions)

View changed files

📝 ScreenToGif/Windows/Other/Insert.xaml (+1 -1)

📄 Description

When testing #882 I've noticed that there is possibility to can close an ongoing import process, but when doing so, exception occurs. The problem is in DialogResult being set when it supposed to be not.

Steps to repro:

  1. open gif animation
  2. insert image before frame 0
  3. while the process is ongoing press cancel

image

The problem was that DialogResult was set in code but also CancelButton had IsCancel property set to true. With that property it means DialogResult is set automatically and actually already getting out of ShowDialog() even the code is still running in the handlers . Removed IsCancel property and allowed the code to set DialogResult and close the window when needed.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/NickeManarin/ScreenToGif/pull/883 **Author:** [@pawlos](https://github.com/pawlos) **Created:** 5/7/2021 **Status:** ✅ Merged **Merged:** 5/8/2021 **Merged by:** [@NickeManarin](https://github.com/NickeManarin) **Base:** `bugfix/883-Exception-when-cancelling-image-import` ← **Head:** `exception-when-closing-starter-insert-task` --- ### 📝 Commits (2) - [`92ade86`](https://github.com/NickeManarin/ScreenToGif/commit/92ade869d8f31c24f57fd507dd24c5ea35a16777) Merge branch 'dev' - [`3a4aa57`](https://github.com/NickeManarin/ScreenToGif/commit/3a4aa57466cad78334586ee397281b4ad3a6c46f) Fix exception when pressing cancel while inserting frames is ongoing ### 📊 Changes **1 file changed** (+1 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `ScreenToGif/Windows/Other/Insert.xaml` (+1 -1) </details> ### 📄 Description When testing #882 I've noticed that there is possibility to can close an ongoing import process, but when doing so, exception occurs. The problem is in `DialogResult` being set when it supposed to be not. Steps to repro: 1. open gif animation 2. insert image before frame 0 3. while the process is ongoing press cancel ![image](https://user-images.githubusercontent.com/1296768/117513396-e01c4580-af91-11eb-9c7b-9cd9b146294a.png) The problem was that `DialogResult` was set in code but also `CancelButton` had `IsCancel` property set to `true`. With that property it means `DialogResult` is set automatically and actually already getting out of `ShowDialog()` even the code is still running in the handlers . Removed `IsCancel` property and allowed the code to set `DialogResult` and close the window when needed. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-02-26 09:34:09 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/ScreenToGif#1244
No description provided.