diff options
author | Michael Stahl <mstahl@redhat.com> | 2016-02-09 14:13:48 +0100 |
---|---|---|
committer | Michael Stahl <mstahl@redhat.com> | 2016-02-09 14:17:40 +0100 |
commit | 678e0ea1472478d248d1a45c1e0ade5ed84f9d46 (patch) | |
tree | f91397f9814ffc4de54e2d4fca03a56c121c5247 /libreofficekit/qa | |
parent | e14bd2d6845cf13a35b14762d6e1e160e8315997 (diff) |
vcl, libreofficekit: gtk_clipboard_wait_for_contents() may return null
Don't crash then.
Change-Id: I4980fe4ea56e023cbf303fa43d1e6b383d983d2e
Diffstat (limited to 'libreofficekit/qa')
-rw-r--r-- | libreofficekit/qa/gtktiledviewer/gtktiledviewer.cxx | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/libreofficekit/qa/gtktiledviewer/gtktiledviewer.cxx b/libreofficekit/qa/gtktiledviewer/gtktiledviewer.cxx index b2962d4e0da1..7ec2b78bc112 100644 --- a/libreofficekit/qa/gtktiledviewer/gtktiledviewer.cxx +++ b/libreofficekit/qa/gtktiledviewer/gtktiledviewer.cxx @@ -656,6 +656,10 @@ static void doPaste(GtkWidget* pButton, gpointer /*pItem*/) if (oTarget) { GtkSelectionData* pSelectionData = gtk_clipboard_wait_for_contents(pClipboard, *oTarget); + if (!pSelectionData) + { + return; + } gint nLength; const guchar* pData = gtk_selection_data_get_data_with_length(pSelectionData, &nLength); bool bSuccess = lok_doc_view_paste(pLOKDocView, aTargetName.c_str(), reinterpret_cast<const char*>(pData), nLength); |