Prevent a crash when symbol->indent is NULL.
authorJohan Dahlin <jdahlin@async.com.br>
Sat, 31 May 2008 14:14:07 +0000 (14:14 +0000)
committerJohan Dahlin <johan@src.gnome.org>
Sat, 31 May 2008 14:14:07 +0000 (14:14 +0000)
2008-05-31  Johan Dahlin  <jdahlin@async.com.br>

    * giscanner/giscannermodule.c (symbol_get_ident): Prevent
    a crash when symbol->indent is NULL.

svn path=/trunk/; revision=276

ChangeLog
giscanner/giscannermodule.c

index 17ee5af..0935ab4 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
 2008-05-31  Johan Dahlin  <jdahlin@async.com.br>
 
+       * giscanner/giscannermodule.c (symbol_get_ident): Prevent
+       a crash when symbol->indent is NULL.
+
        * giscanner/sourcescanner.py (ctype_name): Add ctype_name,
        a function to convert a CTYPE symbol to a string
 
index df25840..3d3e7d9 100644 (file)
@@ -175,6 +175,13 @@ static PyObject *
 symbol_get_ident (PyGISourceSymbol *self,
                  void            *context)
 {
+  
+  if (!self->symbol->ident)
+    {
+      Py_INCREF(Py_None);
+      return Py_None;
+    }
+    
   return PyString_FromString (self->symbol->ident);
 }