From 1b3ee58227cc56b1e2930cc6e45ae264e123f963 Mon Sep 17 00:00:00 2001 From: Tetralet Date: Tue, 7 Jan 2014 15:18:25 +0800 Subject: [PATCH] clean a warning: gtk_clipboard_set_text: assertion `text != NULL' --- src/view.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/view.c b/src/view.c index 00f91c3..364b8a6 100644 --- a/src/view.c +++ b/src/view.c @@ -221,7 +221,8 @@ static gboolean cb_button_press_event(GtkWidget *view, GdkEventButton *event) // backup and restore the clipboard gchar *current_clipboard_str = gtk_clipboard_wait_for_text(selection_primary); - if ((current_clipboard_str == NULL) || (current_clipboard_str[0]=='\0')) { + if (((current_clipboard_str == NULL) || (current_clipboard_str[0]=='\0')) && + selection_primary_str && selection_primary_str[0]) { gtk_clipboard_set_text(selection_primary, selection_primary_str, -1); } else {