summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2012-03-22 10:06:16 +0100
committerStephan Bergmann <sbergman@redhat.com>2012-03-22 10:06:16 +0100
commite1b4216816ba927f171030101f272f7ec0eb8314 (patch)
treecfdcc638ff6c3884e2c97193962308d3057dfdb1 /sc
parentbe79f65e92626a4c6dcda9b31922c53bc7e03349 (diff)
ChartTokenMap can contain null pointers
db3786ee3aa0d8911042c9bbcea02cf36d96dfa1 caused chart2_unoapi test to crash
Diffstat (limited to 'sc')
-rw-r--r--sc/source/ui/unoobj/chart2uno.cxx5
1 files changed, 3 insertions, 2 deletions
diff --git a/sc/source/ui/unoobj/chart2uno.cxx b/sc/source/ui/unoobj/chart2uno.cxx
index 469eb1d8bade..9f5e3cd43961 100644
--- a/sc/source/ui/unoobj/chart2uno.cxx
+++ b/sc/source/ui/unoobj/chart2uno.cxx
@@ -309,9 +309,10 @@ Chart2PositionMap::Chart2PositionMap(SCCOL nAllColCount, SCROW nAllRowCount,
ScTokenPtrMap::iterator tokenIter = pCol->begin();
for (SCROW nRow = 0; !bFoundValues && nRow < nSmallestValueRowIndex; ++nRow)
{
- if (tokenIter != pCol->end() && nRow>=nHeaderRowCount)
+ ScToken* pToken =
+ tokenIter == pCol->end() ? 0 : tokenIter->second;
+ if (pToken && nRow>=nHeaderRowCount)
{
- ScToken* pToken = tokenIter->second;
ScRange aRange;
bool bExternal = false;
StackVar eType = pToken->GetType();