framework/source/services/autorecovery.cxx |   14 ++++++++++----
 1 file changed, 10 insertions(+), 4 deletions(-)

New commits:
commit 6e382304e346c99f1424985ae00b5210a1c898b5
Author:     Justin Luth <[email protected]>
AuthorDate: Mon Sep 29 10:48:41 2025 -0400
Commit:     Justin Luth <[email protected]>
CommitDate: Mon Sep 29 21:06:51 2025 +0200

    tdf#152751: silence autorecovery-provoked 'Invalid file URL'
    
    Clearly if no file is specified,
    we don't need to attempt to erase 'nothing'.
    
    Change-Id: I6fe1110eeb9ff409037168e4421ef55253ea8766
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/191639
    Tested-by: Jenkins
    Reviewed-by: Justin Luth <[email protected]>

diff --git a/framework/source/services/autorecovery.cxx 
b/framework/source/services/autorecovery.cxx
index b7926b0bd8e3..d47cd76a2863 100644
--- a/framework/source/services/autorecovery.cxx
+++ b/framework/source/services/autorecovery.cxx
@@ -2062,10 +2062,16 @@ void 
AutoRecovery::implts_flushConfigItem(AutoRecovery::TDocumentInfo& rInfo, bo
             // DO IT!
             try
             {
-                osl::File::remove(rInfo.OldTempURL);
-                osl::File::remove(rInfo.NewTempURL);
-                rInfo.OldTempURL.clear();
-                rInfo.NewTempURL.clear();
+                if (!rInfo.OldTempURL.isEmpty())
+                {
+                    osl::File::remove(rInfo.OldTempURL);
+                    rInfo.OldTempURL.clear();
+                }
+                if (!rInfo.NewTempURL.isEmpty())
+                {
+                    osl::File::remove(rInfo.NewTempURL);
+                    rInfo.NewTempURL.clear();
+                }
 
                 xModify->removeByName(sID);
             }

Reply via email to