Check if the string is NULL before calling gtk_clipboard_set_text().