summaryrefslogtreecommitdiff
path: root/sc/source/ui/sparklines
diff options
context:
space:
mode:
authorTomaž Vajngerl <tomaz.vajngerl@collabora.co.uk>2022-04-03 13:57:36 +0900
committerTomaž Vajngerl <quikee@gmail.com>2022-04-06 02:59:37 +0200
commit27aa7df0a093c9e18ce591d8c73b524ef7ff40de (patch)
tree505a93564abfc1c9d4a7fbe1e56c385c99cdf952 /sc/source/ui/sparklines
parent3bc9f6176ad540d613a1238466e20f9ad3903881 (diff)
sc: prevent a crash when deleting a sparkline
Change-Id: Idf89d4bbdc2bd29ce55cc3a8fd6707ece345869c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132553 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
Diffstat (limited to 'sc/source/ui/sparklines')
-rw-r--r--sc/source/ui/sparklines/SparklineList.cxx3
1 files changed, 2 insertions, 1 deletions
diff --git a/sc/source/ui/sparklines/SparklineList.cxx b/sc/source/ui/sparklines/SparklineList.cxx
index 744a58bce66e..7ee52ac74e27 100644
--- a/sc/source/ui/sparklines/SparklineList.cxx
+++ b/sc/source/ui/sparklines/SparklineList.cxx
@@ -31,7 +31,8 @@ std::vector<std::shared_ptr<SparklineGroup>> SparklineList::getSparklineGroups()
for (auto iterator = m_aSparklineGroups.begin(); iterator != m_aSparklineGroups.end();)
{
- if (auto pSparklineGroup = iterator->lock())
+ auto pWeakGroup = *iterator;
+ if (auto pSparklineGroup = pWeakGroup.lock())
{
toReturn.push_back(pSparklineGroup);
iterator++;