xmloff/source/core/xmlimp.cxx |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

New commits:
commit 9aae749e99a92e6622fe18539e186e5cb07fa721
Author:     Julien Nabet <serval2...@yahoo.fr>
AuthorDate: Mon Mar 14 20:25:42 2022 +0100
Commit:     Julien Nabet <serval2...@yahoo.fr>
CommitDate: Mon Mar 14 21:48:09 2022 +0100

    Return early if empty ref (xmloff/xmlimp)
    
    + fix a comment, the function uses "bool" not old "sal_Bool"
    
    Change-Id: I777dc93450a56eb826d15691d56c23cb051a4afb
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/131561
    Tested-by: Jenkins
    Reviewed-by: Julien Nabet <serval2...@yahoo.fr>

diff --git a/xmloff/source/core/xmlimp.cxx b/xmloff/source/core/xmlimp.cxx
index 9c68c2be6da1..a710e87b3bb7 100644
--- a/xmloff/source/core/xmlimp.cxx
+++ b/xmloff/source/core/xmlimp.cxx
@@ -1627,7 +1627,7 @@ OUString SvXMLImport::GetAbsoluteReference(const 
OUString& rValue) const
 
 bool SvXMLImport::IsODFVersionConsistent( const OUString& aODFVersion )
 {
-    // the check returns sal_False only if the storage version could be 
retrieved
+    // the check returns false only if the storage version could be retrieved
     bool bResult = true;
 
     if ( !aODFVersion.isEmpty() && aODFVersion.compareTo( ODFVER_012_TEXT ) >= 
0 )
@@ -1637,6 +1637,8 @@ bool SvXMLImport::IsODFVersionConsistent( const OUString& 
aODFVersion )
         try
         {   // don't use getDocumentStorage(), it's temporary and latest 
version
             uno::Reference<embed::XStorage> const xStor(GetSourceStorage());
+            if (!xStor.is())
+                return bResult;
             uno::Reference< beans::XPropertySet > xStorProps( xStor, 
uno::UNO_QUERY_THROW );
 
             // the check should be done only for OASIS format

Reply via email to