[GH-ISSUE #1434] [Crash] System.NullReferenceException at RemoveRoutedEventHandlers when exporting with Gifski #3721

Open
opened 2026-03-01 19:15:33 +03:00 by kerem · 0 comments
Owner

Originally created by @Poppypy on GitHub (Feb 10, 2026).
Original GitHub issue: https://github.com/NickeManarin/ScreenToGif/issues/1434

Originally assigned to: @NickeManarin on GitHub.

Describe the bug
I am experiencing a consistent crash when exporting a GIF using the Gifski encoder. The crash occurs during the export process.

To Reproduce

  1. Record a screen area.
  2. Go to the Editor.
  3. Export using the "Gifski" encoder.
  4. The application crashes with the error below.

Error Log / Stack Trace
Title: Removing event handlers
Version: 2.42.1
Date: 02/10/2026
Message: Object reference not set to an instance of an object.
Type: System.NullReferenceException
Source: ScreenToGif
TargetSite: Void RemoveRoutedEventHandlers(System.Windows.UIElement, System.Windows.RoutedEvent)
StackTrace:
at ScreenToGif.Util.Other.RemoveRoutedEventHandlers(UIElement element, RoutedEvent routedEvent) in R:\Source\ScreenToGif\ScreenToGif\Util\Other.cs:line 350

Environment

  • OS: Windows
  • Version: 2.42.1
  • Encoder: Gifski (External/Internal)

Additional context
It seems to happen multiple times as shown in the repeated logs. I have tried replacing the gifski.dll but the issue persists.

26_02_10.txt

Originally created by @Poppypy on GitHub (Feb 10, 2026). Original GitHub issue: https://github.com/NickeManarin/ScreenToGif/issues/1434 Originally assigned to: @NickeManarin on GitHub. **Describe the bug** I am experiencing a consistent crash when exporting a GIF using the Gifski encoder. The crash occurs during the export process. **To Reproduce** 1. Record a screen area. 2. Go to the Editor. 3. Export using the "Gifski" encoder. 4. The application crashes with the error below. **Error Log / Stack Trace** Title: Removing event handlers Version: 2.42.1 Date: 02/10/2026 Message: Object reference not set to an instance of an object. Type: System.NullReferenceException Source: ScreenToGif TargetSite: Void RemoveRoutedEventHandlers(System.Windows.UIElement, System.Windows.RoutedEvent) StackTrace: at ScreenToGif.Util.Other.RemoveRoutedEventHandlers(UIElement element, RoutedEvent routedEvent) in R:\Source\ScreenToGif\ScreenToGif\Util\Other.cs:line 350 **Environment** - OS: Windows - Version: 2.42.1 - Encoder: Gifski (External/Internal) **Additional context** It seems to happen multiple times as shown in the repeated logs. I have tried replacing the gifski.dll but the issue persists. [26_02_10.txt](https://github.com/user-attachments/files/25197791/26_02_10.txt)
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#3721
No description provided.