diff options
author | Attila Szűcs <szucs.attila3@nisz.hu> | 2022-06-21 15:27:35 +0200 |
---|---|---|
committer | Andras Timar <andras.timar@collabora.com> | 2022-06-24 13:42:30 +0200 |
commit | d6754ec27db24e0049089c84c82c8ea406fe1748 (patch) | |
tree | 613e7cd6fca09cea7ac65ca5bfd551e64e60f9b8 /sc/source | |
parent | 932af81916bd36605e689598f5bad2130e5eebf0 (diff) |
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 <nemeth@numbertext.org>
Reviewed-by: László Németh <nemeth@numbertext.org>
(cherry picked from commit c4c827e1d370dcc351c4dddc601b3c37fc71564b)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/136323
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Diffstat (limited to 'sc/source')
-rw-r--r-- | sc/source/ui/view/viewdata.cxx | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/sc/source/ui/view/viewdata.cxx b/sc/source/ui/view/viewdata.cxx index 62bdca38a3e4..26387834f45a 100644 --- a/sc/source/ui/view/viewdata.cxx +++ b/sc/source/ui/view/viewdata.cxx @@ -1151,7 +1151,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(); |