tdf#125552 Don't show deleted certificate folder in Certificate Path dialog

Added a check to ensure that certificate folder exists.

Change-Id: I351a58bbc606ac48eb9bdc85aaf0dbf8533a3d10
Reviewed-on: https://gerrit.libreoffice.org/73149
Tested-by: Jenkins
Reviewed-by: Katarina Behrens <Katarina.Behrens@cib.de>
diff --git a/cui/source/options/certpath.cxx b/cui/source/options/certpath.cxx
index 9e3406d..9bd43b8 100644
--- a/cui/source/options/certpath.cxx
+++ b/cui/source/options/certpath.cxx
@@ -90,7 +90,23 @@ CertPathDialog::CertPathDialog(weld::Window* pParent)
            officecfg::Office::Common::Security::Scripting::CertDir::get().get_value_or(OUString());

        if (!sUserSetCertPath.isEmpty())
            AddCertPath(m_sManual, sUserSetCertPath);
        {
            // check existence
            ::osl::DirectoryItem aUserPathItem;
            OUString sUserSetCertURLPath;
            osl::FileBase::getFileURLFromSystemPath(sUserSetCertPath, sUserSetCertURLPath);
            ::osl::FileBase::RC result = ::osl::DirectoryItem::get( sUserSetCertURLPath, aUserPathItem );
            if ( result == ::osl::FileBase::E_None  )
            {
                ::osl::FileStatus aStatus( osl_FileStatus_Mask_Validate );
                result = aUserPathItem.getFileStatus( aStatus );
                if ( result == ::osl::FileBase::E_None  )
                {
                    // the cert path exists
                    AddCertPath(m_sManual, sUserSetCertPath);
                }
            }
        }
    }
    catch (const uno::Exception &)
    {