Skip to content

Commit 8748769

Browse files
yuto-trdCopilot
andcommitted
Update src/Beutl.Operators/Source/SourceVideoOperator.cs
Co-authored-by: Copilot <[email protected]>
1 parent a127168 commit 8748769

File tree

1 file changed

+5
-8
lines changed

1 file changed

+5
-8
lines changed

src/Beutl.Operators/Source/SourceVideoOperator.cs

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -40,15 +40,12 @@ protected override void OnDetachedFromHierarchy(in HierarchyAttachmentEventArgs
4040
{
4141
base.OnDetachedFromHierarchy(args);
4242

43-
if (Value is { } value)
43+
if (Value is { } value && _handler != null)
4444
{
45-
if (_handler != null)
46-
{
47-
value.Source.Edited -= _handler;
48-
value.OffsetPosition.Edited -= _handler;
49-
value.Speed.Edited -= _handler;
50-
value.IsLoop.Edited -= _handler;
51-
}
45+
value.Source.Edited -= _handler;
46+
value.OffsetPosition.Edited -= _handler;
47+
value.Speed.Edited -= _handler;
48+
value.IsLoop.Edited -= _handler;
5249
}
5350

5451
_handler = null;

0 commit comments

Comments
 (0)