From 104415a4de057e8f811a8c2bb58edfaa30742c47 Mon Sep 17 00:00:00 2001 From: itsmattkc Date: Thu, 2 Jan 2020 05:01:39 +1100 Subject: [PATCH] razor tool: only push an undocommand if blocks were actually detected to split --- app/widget/timelinewidget/tool/razor.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/widget/timelinewidget/tool/razor.cpp b/app/widget/timelinewidget/tool/razor.cpp index 87bafafda..52558d02b 100644 --- a/app/widget/timelinewidget/tool/razor.cpp +++ b/app/widget/timelinewidget/tool/razor.cpp @@ -83,7 +83,9 @@ void TimelineWidget::RazorTool::MouseRelease(TimelineViewMouseEvent *event) split_tracks_.clear(); - Core::instance()->undo_stack()->push(new BlockSplitPreservingLinksCommand(blocks_to_split, {split_time})); + if (!blocks_to_split.isEmpty()) { + Core::instance()->undo_stack()->push(new BlockSplitPreservingLinksCommand(blocks_to_split, {split_time})); + } dragging_ = false; }