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.
This commit is contained in:
David Capello 2024-11-21 10:24:39 -03:00
parent b03dffb5cd
commit 8c55c1db07
2 changed files with 5 additions and 3 deletions

2
laf

@ -1 +1 @@
Subproject commit 370ab278567c97d9ee067b71437ee7fba0022ab6
Subproject commit 631bc339fa7a4b5adb9c4caee5b07dac18f2219a

View File

@ -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