From 80257d2b9a5979af816654ec45b539848fc19eb3 Mon Sep 17 00:00:00 2001 From: Mike Kestner Date: Wed, 28 Jan 2004 05:12:55 +0000 Subject: [PATCH] 2004-01-27 Mike Kestner * gtk/SelectionData.custom : guard against null in get_Text. [Fixes #52713] svn path=/trunk/gtk-sharp/; revision=22566 --- ChangeLog | 5 +++++ gtk/SelectionData.custom | 5 ++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 9cb2c89e6..861ea4cc7 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2004-01-27 Mike Kestner + + * gtk/SelectionData.custom : guard against null in get_Text. + [Fixes #52713] + 2004-01-27 Mike Kestner * glue/selectiondata.c : expose data field. diff --git a/gtk/SelectionData.custom b/gtk/SelectionData.custom index 905be8729..f0d4289a3 100644 --- a/gtk/SelectionData.custom +++ b/gtk/SelectionData.custom @@ -24,7 +24,10 @@ public string Text { get { - return GLibSharp.Marshaller.PtrToStringGFree (gtk_selection_data_get_text (Handle)); + IntPtr text = gtk_selection_data_get_text (Handle); + if (text == IntPtr.Zero) + return null; + return GLibSharp.Marshaller.PtrToStringGFree (text); } set { gtk_selection_data_set_text (Handle, value, value.Length);