Kaydet (Commit) b9b93004 authored tarafından Julien Nabet's avatar Julien Nabet Kaydeden (comit) Caolán McNamara

tdf#113834: fix crash when service host empty

The crash affects Windows, not Linux where an error popup appears instead (MacOs?)
It seems the fact the url was empty triggers an exception in ucbhelper::Content ctr
So let's put the lines in the try catch and log the exception.
See comments of bugtracker for slight more details.

Change-Id: I60e55be488632ff6e0106fde832a818c6431f58e
Reviewed-on: https://gerrit.libreoffice.org/71321
Tested-by: Jenkins
Reviewed-by: 's avatarCaolán McNamara <caolanm@redhat.com>
Tested-by: 's avatarCaolán McNamara <caolanm@redhat.com>
üst 598c96a9
......@@ -25,6 +25,7 @@
#include <svtools/PlaceEditDialog.hxx>
#include <svtools/ServerDetailsControls.hxx>
#include <sal/log.hxx>
#include <config_oauth2.h>
......@@ -446,12 +447,11 @@ IMPL_LINK_NOARG( CmisDetailsContainer, RefreshReposHdl, weld::Button&, void )
catch( const Exception& )
{}
// Get the Content
::ucbhelper::Content aCnt( sUrl, m_xCmdEnv, comphelper::getProcessComponentContext() );
Sequence<OUString> aProps { "Title" };
try
{
// Get the Content
::ucbhelper::Content aCnt( sUrl, m_xCmdEnv, comphelper::getProcessComponentContext() );
Sequence<OUString> aProps { "Title" };
Reference< XResultSet > xResultSet( aCnt.createCursor( aProps ), UNO_QUERY_THROW );
Reference< XContentAccess > xAccess( xResultSet, UNO_QUERY_THROW );
while ( xResultSet->next() )
......@@ -467,8 +467,9 @@ IMPL_LINK_NOARG( CmisDetailsContainer, RefreshReposHdl, weld::Button&, void )
m_pDialog->m_xLBRepository->append_text(sName);
}
}
catch ( const Exception& )
catch ( const Exception& e)
{
SAL_WARN( "svtools.dialogs", "RefreshReposHdl exception=" << e );
}
// Auto-select the first one
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment