diff options
author | Luboš Luňák <l.lunak@collabora.com> | 2022-06-23 16:39:39 +0200 |
---|---|---|
committer | Adolfo Jayme Barrientos <fitojb@ubuntu.com> | 2022-06-26 02:20:32 +0200 |
commit | 4e2f3912440e555f62ea9f5b8182fd6c07560001 (patch) | |
tree | 1e0bf01d4f73e74533e37185e72c3c90fad96386 | |
parent | sw: fix crash in SwLayoutFrame::GetContentPos (diff) | |
download | core-4e2f3912440e555f62ea9f5b8182fd6c07560001.tar.gz core-4e2f3912440e555f62ea9f5b8182fd6c07560001.zip |
handle nullptr SharedString in ScQueryEvaluator (tdf#149679)
This may be the case if the string comes from ScMatrix::Get()
for ScMatValType::Empty.
Change-Id: I35013449611bf7ffd1bc74e023d76597af010724
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/136347
Tested-by: Jenkins
Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
(cherry picked from commit ba59bd11521373f800c6b718e7e21439c1452e84)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/136376
Reviewed-by: Adolfo Jayme Barrientos <fitojb@ubuntu.com>
-rw-r--r-- | sc/source/core/data/queryevaluator.cxx | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/sc/source/core/data/queryevaluator.cxx b/sc/source/core/data/queryevaluator.cxx index 1e16398a4cfb..12e034da6fa0 100644 --- a/sc/source/core/data/queryevaluator.cxx +++ b/sc/source/core/data/queryevaluator.cxx @@ -481,8 +481,9 @@ std::pair<bool, bool> ScQueryEvaluator::compareByString(const ScQueryEntry& rEnt const rtl_uString* pQuer = rItem.maString.getDataIgnoreCase(); const rtl_uString* pCellStr = rSource.getDataIgnoreCase(); - assert(pQuer != nullptr); assert(pCellStr != nullptr); + if (pQuer == nullptr) + pQuer = svl::SharedString::getEmptyString().getDataIgnoreCase(); const sal_Int32 nIndex = (rEntry.eOp == SC_ENDS_WITH || rEntry.eOp == SC_DOES_NOT_END_WITH) |