summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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();