]> git.saurik.com Git - wxWidgets.git/commitdiff
Change the wxCharBuffer typemap to make sure there is data before
authorRobin Dunn <robin@alldunn.com>
Tue, 31 Oct 2006 17:40:31 +0000 (17:40 +0000)
committerRobin Dunn <robin@alldunn.com>
Tue, 31 Oct 2006 17:40:31 +0000 (17:40 +0000)
accessing it, set result to an empty string if now.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@42867 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

wxPython/src/my_typemaps.i

index ea5588022d22c6061226268f8cde2bae1cbe16fa..331ccc07eb32305a60faf8bdf883a1bac2e8dbbb 100644 (file)
@@ -125,7 +125,10 @@ MAKE_INT_ARRAY_TYPEMAPS(styles, styles_field)
 
 
 %typemap(out) wxCharBuffer {
-    $result = PyString_FromString((char*)$1.data());
+    if ($1.data())
+        $result = PyString_FromString((char*)$1.data());
+    else
+        $result = PyString_FromString("");
 }