+2010-07-09  Tom Tromey  <tromey@redhat.com>
+
+       * python/py-prettyprint.c (gdbpy_get_display_hint): Don't use
+       'hint' if it is NULL.
+
 2010-07-09  Hui Zhu  <teawater@gmail.com>
 
        * source.c (print_source_lines_base): Add check for noprint.
 
     return NULL;
 
   hint = PyObject_CallMethodObjArgs (printer, gdbpy_display_hint_cst, NULL);
-  if (gdbpy_is_string (hint))
-    result = python_string_to_host_string (hint);
   if (hint)
-    Py_DECREF (hint);
+    {
+      if (gdbpy_is_string (hint))
+       result = python_string_to_host_string (hint);
+      Py_DECREF (hint);
+    }
   else
     gdbpy_print_stack ();