diff options
-rw-r--r-- | vcl/unx/gtk3/gtk3gtkinst.cxx | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/vcl/unx/gtk3/gtk3gtkinst.cxx b/vcl/unx/gtk3/gtk3gtkinst.cxx index e5b1cdf4f1d6..bd221af10cdb 100644 --- a/vcl/unx/gtk3/gtk3gtkinst.cxx +++ b/vcl/unx/gtk3/gtk3gtkinst.cxx @@ -606,6 +606,12 @@ void VclGtkClipboard::setContents( const Reference< css::datatransfer::XTransferable >& xTrans, const Reference< css::datatransfer::clipboard::XClipboardOwner >& xClipboardOwner ) { + css::uno::Sequence<css::datatransfer::DataFlavor> aFormats; + if (xTrans.is()) + { + aFormats = xTrans->getTransferDataFlavors(); + } + osl::ClearableMutexGuard aGuard( m_aMutex ); Reference< datatransfer::clipboard::XClipboardOwner > xOldOwner( m_aOwner ); Reference< datatransfer::XTransferable > xOldContents( m_aContents ); @@ -624,7 +630,6 @@ void VclGtkClipboard::setContents( assert(m_aGtkTargets.empty()); if (m_aContents.is()) { - css::uno::Sequence<css::datatransfer::DataFlavor> aFormats = xTrans->getTransferDataFlavors(); std::vector<GtkTargetEntry> aGtkTargets(m_aConversionHelper.FormatsToGtk(aFormats)); if (!aGtkTargets.empty()) { |