From 8c55c1db07ba5d83c2788588a6e0080a775a79ad Mon Sep 17 00:00:00 2001 From: David Capello Date: Thu, 21 Nov 2024 10:24:39 -0300 Subject: [PATCH] Fix crash dragging files on timeline in certain cases (fix #4801) With the combination of 8b0b1d8d1e2624eaa8433df58b83845902cd7975 (allowing transactions in docs without context) and be17c4832405be44193a4d24268c38da80369743 (getting the active DocRange from Doc context), we were getting a crash accessing a nullptr context. --- laf | 2 +- src/app/cmd_transaction.cpp | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/laf b/laf index 370ab2785..631bc339f 160000 --- a/laf +++ b/laf @@ -1 +1 @@ -Subproject commit 370ab278567c97d9ee067b71437ee7fba0022ab6 +Subproject commit 631bc339fa7a4b5adb9c4caee5b07dac18f2219a diff --git a/src/app/cmd_transaction.cpp b/src/app/cmd_transaction.cpp index 96d7578f2..30d5f1191 100644 --- a/src/app/cmd_transaction.cpp +++ b/src/app/cmd_transaction.cpp @@ -129,12 +129,14 @@ SpritePosition CmdTransaction::calcSpritePosition() const bool CmdTransaction::isDocRangeEnabled() const { - return context()->range().enabled(); + return (context() ? context()->range().enabled(): + false); } view::RealRange CmdTransaction::calcDocRange() const { - return context()->range(); + return (context() ? context()->range(): + view::RealRange()); } } // namespace app