sc/source/core/tool/interpr1.cxx |    9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

New commits:
commit fc92e4e8c51cee379781b15670507e72510a9f60
Author:     Eike Rathke <er...@redhat.com>
AuthorDate: Fri Oct 30 16:57:16 2020 +0100
Commit:     Eike Rathke <er...@redhat.com>
CommitDate: Sat Oct 31 11:46:43 2020 +0100

    Let INDIRECT() bail out early on empty string
    
    e.g. if obtained from yet empty cell.
    
    Change-Id: I18597b86b37d5d216213f9a101e8b84b307b2a34
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105090
    Tested-by: Jenkins
    Reviewed-by: Eike Rathke <er...@redhat.com>

diff --git a/sc/source/core/tool/interpr1.cxx b/sc/source/core/tool/interpr1.cxx
index 3268efdf2015..321f80328095 100644
--- a/sc/source/core/tool/interpr1.cxx
+++ b/sc/source/core/tool/interpr1.cxx
@@ -8084,11 +8084,18 @@ void ScInterpreter::ScIndirect()
         bTryXlA1 = false;
     }
 
+    OUString sRefStr = GetString().getString();
+    if (sRefStr.isEmpty())
+    {
+        // Bail out early for empty cells, rely on "we do have a string" below.
+        PushError( FormulaError::NoRef);
+        return;
+    }
 
     const ScAddress::Details aDetails( bTryXlA1 ? FormulaGrammar::CONV_OOO : 
eConv, aPos );
     const ScAddress::Details aDetailsXlA1( FormulaGrammar::CONV_XL_A1, aPos );
     SCTAB nTab = aPos.Tab();
-    OUString sRefStr = GetString().getString();
+
     ScRefAddress aRefAd, aRefAd2;
     ScAddress::ExternalInfo aExtInfo;
     if ( ConvertDoubleRef(mrDoc, sRefStr, nTab, aRefAd, aRefAd2, aDetails, 
&aExtInfo) ||
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to