summaryrefslogtreecommitdiff
path: root/dbaccess
diff options
context:
space:
mode:
authorJulien Nabet <serval2412@yahoo.fr>2018-09-02 10:02:42 +0200
committerJulien Nabet <serval2412@yahoo.fr>2018-09-02 13:03:24 +0200
commit307e84ac706345510a4d347fbaaf3d53f8249dea (patch)
tree21c3247df2112eafde826962452f46b5806e0ab8 /dbaccess
parent4f3dec1104a21d93d400c76ab0ae85083aec8492 (diff)
tdf#118750: fix migration assistant
by catching throw if backup content file doesn't exist Regression from 9ceeb4619ba762c47589023d99c43c774caab441 Change-Id: I68bb27763573217a9dff0e263cb8be88e15255ad Reviewed-on: https://gerrit.libreoffice.org/59900 Tested-by: Jenkins Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
Diffstat (limited to 'dbaccess')
-rw-r--r--dbaccess/source/core/dataaccess/datasource.cxx11
1 files changed, 9 insertions, 2 deletions
diff --git a/dbaccess/source/core/dataaccess/datasource.cxx b/dbaccess/source/core/dataaccess/datasource.cxx
index db19f9edd912..8ecba91846d4 100644
--- a/dbaccess/source/core/dataaccess/datasource.cxx
+++ b/dbaccess/source/core/dataaccess/datasource.cxx
@@ -621,8 +621,15 @@ Reference< XConnection > ODatabaseSource::buildLowLevelConnection(const OUString
Reference<XStorage> xRootStorage = m_pImpl->getOrCreateRootStorage();
constexpr char BACKUP_XML_NAME[] = "content_before_migration.xml";
- if(xRootStorage->isStreamElement(BACKUP_XML_NAME))
- xRootStorage->removeElement(BACKUP_XML_NAME);
+ try
+ {
+ if(xRootStorage->isStreamElement(BACKUP_XML_NAME))
+ xRootStorage->removeElement(BACKUP_XML_NAME);
+ }
+ catch (NoSuchElementException&)
+ {
+ SAL_INFO("dbaccess", "No file content_before_migration.xml found" );
+ }
xRootStorage->copyElementTo("content.xml", xRootStorage,
BACKUP_XML_NAME);