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

New commits:
commit 95a01158e5021f2babc04a291523734a0a6d8f4d
Author:     Caolán McNamara <caol...@redhat.com>
AuthorDate: Sat Dec 18 19:28:00 2021 +0000
Commit:     Michael Stahl <michael.st...@allotropia.de>
CommitDate: Tue Dec 21 11:11:07 2021 +0100

    ofz#42605 Null-dereference
    
    Change-Id: Ief752f20aa3e7672e4ed7f6cd1809ee56a096c43
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/127052
    Tested-by: Jenkins
    Reviewed-by: Michael Stahl <michael.st...@allotropia.de>

diff --git a/sc/source/core/tool/compiler.cxx b/sc/source/core/tool/compiler.cxx
index 628465e0d085..cde3c16f4f4e 100644
--- a/sc/source/core/tool/compiler.cxx
+++ b/sc/source/core/tool/compiler.cxx
@@ -4325,7 +4325,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