sc/source/core/tool/compiler.cxx |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

New commits:
commit 58a0127e15a13996d16acf9a9ad000ed9e6ec91d
Author:     Caolán McNamara <caol...@redhat.com>
AuthorDate: Sat Dec 18 19:28:00 2021 +0000
Commit:     Caolán McNamara <caol...@redhat.com>
CommitDate: Sun Dec 19 16:45:39 2021 +0100

    ofz#42605 Null-dereference
    
    Change-Id: Ief752f20aa3e7672e4ed7f6cd1809ee56a096c43
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/127051
    Tested-by: Jenkins
    Reviewed-by: Caolán McNamara <caol...@redhat.com>

diff --git a/sc/source/core/tool/compiler.cxx b/sc/source/core/tool/compiler.cxx
index dfed2b0e0202..7a60d5fcabfc 100644
--- a/sc/source/core/tool/compiler.cxx
+++ b/sc/source/core/tool/compiler.cxx
@@ -4380,7 +4380,8 @@ bool ScCompiler::NextNewToken( bool bInArray )
          * handled by IsPredetectedReference(), this case here remains for
          * manual/API input. */
         OUString aBad( aFormula.copy( nSrcPos-1 ) );
-        eLastOp = pArr->AddBad( aBad )->GetOpCode();
+        const FormulaToken* pBadToken = pArr->AddBad(aBad);
+        eLastOp = pBadToken ? pBadToken->GetOpCode() : ocNone;
         return false;
     }
 

Reply via email to