diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2015-10-21 10:56:24 +0200 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2015-10-21 10:57:59 +0200 |
commit | 115fa590dc7d4f37714d514309643896a5041ab4 (patch) | |
tree | 48363b83a0bf95ec5c03d929329f54c155b5b00a /nlpsolver | |
parent | 5b7e8efbf4d73e385c8fb3469a23c0b2592bfb57 (diff) |
More plausible fix
...for 7c465e7f9e8b5c34a4926fb0de84de70aee8f37d "coverity#1326260 Explicit null
dereferenced"
Change-Id: I3b7fb8195c29b7e447fbe31f823cd00d7a820e95
Diffstat (limited to 'nlpsolver')
-rw-r--r-- | nlpsolver/src/com/sun/star/comp/Calc/NLPSolver/BaseNLPSolver.java | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/nlpsolver/src/com/sun/star/comp/Calc/NLPSolver/BaseNLPSolver.java b/nlpsolver/src/com/sun/star/comp/Calc/NLPSolver/BaseNLPSolver.java index 16bb7e861605..e1386a6e52c3 100644 --- a/nlpsolver/src/com/sun/star/comp/Calc/NLPSolver/BaseNLPSolver.java +++ b/nlpsolver/src/com/sun/star/comp/Calc/NLPSolver/BaseNLPSolver.java @@ -246,8 +246,10 @@ public abstract class BaseNLPSolver extends WeakBase RowInfo currentRow = null; int lastSheet = -1, lastRow = -1; for (int i = 0; i < m_variableCount; i++) { - if (lastSheet == m_variables[i].Sheet && lastRow == m_variables[i].Row && - currentRow != null && currentRow.EndCol == m_variables[i].Column - 1) + boolean match = lastSheet == m_variables[i].Sheet && + lastRow == m_variables[i].Row; + assert !match || currentRow != null; + if (match && currentRow.EndCol == m_variables[i].Column - 1) currentRow.EndCol++; else { currentRow = new RowInfo(m_variables[i].Sheet, m_variables[i].Row); |