sc/source/ui/view/viewdata.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
New commits: commit 12fd3f7ba73d2fd03b88513160545fab8edc8a20 Author: Attila Szűcs <szucs.atti...@nisz.hu> AuthorDate: Tue Jun 21 15:27:35 2022 +0200 Commit: László Németh <nem...@numbertext.org> CommitDate: Thu Jun 23 15:43:00 2022 +0200 tdf#149574 sc: fix missing nullptr check Regression from commit 605b4ba57b2daa447af9d43d3759079e15df8148 "tdf#43958 sc: fix fill by selecting merged cell". Check if GetPattern(actual cell) is not nullptr, before using it. This is not the real problem of Bug 149574, but it is a problem anyway, and it fixes this bug. The real problem is the wrong ViewData::nTabNo, that point to an already deleted table, (fixed in 954d119db932434dc976ef739c643be0d9c7023c "tdf#149502 sc: crash fix: Change in Table destruction"). Co-authored-by: Tibor Nagy (NISZ) Change-Id: I26fc629ccf354c9e0c2662d61254d01be91d08f2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/136230 Tested-by: László Németh <nem...@numbertext.org> Reviewed-by: László Németh <nem...@numbertext.org> diff --git a/sc/source/ui/view/viewdata.cxx b/sc/source/ui/view/viewdata.cxx index 88d57f106a3b..69ebe09d22d4 100644 --- a/sc/source/ui/view/viewdata.cxx +++ b/sc/source/ui/view/viewdata.cxx @@ -1155,7 +1155,7 @@ ScMarkType ScViewData::GetSimpleArea( ScRange & rRange, ScMarkData & rNewMark ) if (eMarkType == SC_MARK_NONE) eMarkType = SC_MARK_SIMPLE; const ScPatternAttr* pMarkPattern = mrDoc.GetPattern(GetCurX(), GetCurY(), GetTabNo()); - if (pMarkPattern->GetItemSet().GetItemState(ATTR_MERGE, false) == SfxItemState::SET) + if (pMarkPattern && pMarkPattern->GetItemSet().GetItemState(ATTR_MERGE, false) == SfxItemState::SET) { SCROW nRow = pMarkPattern->GetItem(ATTR_MERGE).GetRowMerge(); SCCOL nCol = pMarkPattern->GetItem(ATTR_MERGE).GetColMerge();