]> git.saurik.com Git - wxWidgets.git/commitdiff
pango_font_description_get_family() can return NULL
authorVadim Zeitlin <vadim@wxwidgets.org>
Sat, 6 May 2006 21:48:02 +0000 (21:48 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Sat, 6 May 2006 21:48:02 +0000 (21:48 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@39084 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/unix/fontutil.cpp

index 3081336057c35ba56865fb8fd45f67a49385c924..7ca376fb91e03988707e4bf4390570c528cb3095 100644 (file)
@@ -140,7 +140,10 @@ wxFontFamily wxNativeFontInfo::GetFamily() const
     // around a bug in the 64-bit glib shipped with solaris 10, -1 causes it
     // to try to allocate 2^32 bytes.
     const char *family_name = pango_font_description_get_family( description );
-    char *family_text = g_ascii_strdown( family_name, family_name ? strlen( family_name ) : 0 );
+    if ( !family_name )
+        return ret;
+
+    char *family_text = g_ascii_strdown( family_name, strlen( family_name ) );
     // Check for some common fonts, to salvage what we can from the current win32 centric wxFont API:
     if (strncmp( family_text, "monospace", 9 ) == 0)
         ret = wxFONTFAMILY_TELETYPE; // begins with "Monospace"