# Buggy code
def to_string(node):
    """Convert Doxygen node content to a string."""
    result = []
    for p in node.content_:
        value = p.value
        if not isinstance(value, six.text_type):
            value = value.valueOf_
        result.append(value)
    return " ".join(result)


# Traceback (AttributeError)
# Sphinx version: 1.8.2
# Python version: 2.7.12 (CPython)
# Docutils version: 0.14
# Jinja2 version: 2.10
# Last messages:
#   Running Sphinx v1.8.2
#   making output directory...
#   building [mo]: targets for 0 po files that are out of date
#   building [html]: targets for 2 source files that are out of date
#   updating environment:
#   2 added, 0 changed, 0 removed
#   reading sources... [ 50%] doxydoc
# Loaded extensions:
#   sphinx.ext.mathjax (1.8.2) from /home/stbr6072/.local/lib/python2.7/site-packages/sphinx/ext/mathjax.pyc
#   alabaster (0.7.12) from /home/stbr6072/.local/lib/python2.7/site-packages/alabaster/__init__.pyc
#   breathe (4.11.0) from /usr/local/lib/python2.7/dist-packages/breathe-4.11.0-py2.7.egg/breathe/__init__.pyc
Traceback (most recent call last):
File "/home/stbr6072/.local/lib/python2.7/site-packages/sphinx/cmd/build.py", line 304, in build_main
app.build(args.force_all, filenames)
File "/home/stbr6072/.local/lib/python2.7/site-packages/sphinx/application.py", line 341, in build
self.builder.build_update()
File "/home/stbr6072/.local/lib/python2.7/site-packages/sphinx/builders/__init__.py", line 347, in build_update
len(to_build))
File "/home/stbr6072/.local/lib/python2.7/site-packages/sphinx/builders/__init__.py", line 360, in build
updated_docnames = set(self.read())
File "/home/stbr6072/.local/lib/python2.7/site-packages/sphinx/builders/__init__.py", line 468, in read
self._read_serial(docnames)
File "/home/stbr6072/.local/lib/python2.7/site-packages/sphinx/builders/__init__.py", line 490, in _read_serial
self.read_doc(docname)
File "/home/stbr6072/.local/lib/python2.7/site-packages/sphinx/builders/__init__.py", line 534, in read_doc
doctree = read_doc(self.app, self.env, self.env.doc2path(docname))
File "/home/stbr6072/.local/lib/python2.7/site-packages/sphinx/io.py", line 318, in read_doc
pub.publish()
File "/home/stbr6072/.local/lib/python2.7/site-packages/docutils/core.py", line 217, in publish
self.settings)
File "/home/stbr6072/.local/lib/python2.7/site-packages/docutils/readers/__init__.py", line 72, in read
self.parse()
File "/home/stbr6072/.local/lib/python2.7/site-packages/docutils/readers/__init__.py", line 78, in parse
self.parser.parse(self.input, document)
File "/home/stbr6072/.local/lib/python2.7/site-packages/sphinx/parsers.py", line 88, in parse
self.statemachine.run(inputstring, document, inliner=self.inliner)
File "/home/stbr6072/.local/lib/python2.7/site-packages/docutils/parsers/rst/states.py", line 171, in run
input_source=document['source'])
File "/home/stbr6072/.local/lib/python2.7/site-packages/docutils/statemachine.py", line 239, in run
context, state, transitions)
File "/home/stbr6072/.local/lib/python2.7/site-packages/docutils/statemachine.py", line 460, in check_line
return method(match, context, next_state)
File "/home/stbr6072/.local/lib/python2.7/site-packages/docutils/parsers/rst/states.py", line 2753, in underline
self.section(title, source, style, lineno - 1, messages)
File "/home/stbr6072/.local/lib/python2.7/site-packages/docutils/parsers/rst/states.py", line 327, in section
self.new_subsection(title, lineno, messages)
File "/home/stbr6072/.local/lib/python2.7/site-packages/docutils/parsers/rst/states.py", line 395, in new_subsection
node=section_node, match_titles=True)
File "/home/stbr6072/.local/lib/python2.7/site-packages/docutils/parsers/rst/states.py", line 282, in nested_parse
node=node, match_titles=match_titles)
File "/home/stbr6072/.local/lib/python2.7/site-packages/docutils/parsers/rst/states.py", line 196, in run
results = StateMachineWS.run(self, input_lines, input_offset)
File "/home/stbr6072/.local/lib/python2.7/site-packages/docutils/statemachine.py", line 239, in run
context, state, transitions)
File "/home/stbr6072/.local/lib/python2.7/site-packages/docutils/statemachine.py", line 460, in check_line
return method(match, context, next_state)
File "/home/stbr6072/.local/lib/python2.7/site-packages/docutils/parsers/rst/states.py", line 2328, in explicit_markup
self.explicit_list(blank_finish)
File "/home/stbr6072/.local/lib/python2.7/site-packages/docutils/parsers/rst/states.py", line 2358, in explicit_list
match_titles=self.state_machine.match_titles)
File "/home/stbr6072/.local/lib/python2.7/site-packages/docutils/parsers/rst/states.py", line 319, in nested_list_parse
node=node, match_titles=match_titles)
File "/home/stbr6072/.local/lib/python2.7/site-packages/docutils/parsers/rst/states.py", line 196, in run
results = StateMachineWS.run(self, input_lines, input_offset)
File "/home/stbr6072/.local/lib/python2.7/site-packages/docutils/statemachine.py", line 239, in run
context, state, transitions)
File "/home/stbr6072/.local/lib/python2.7/site-packages/docutils/statemachine.py", line 460, in check_line
return method(match, context, next_state)
File "/home/stbr6072/.local/lib/python2.7/site-packages/docutils/parsers/rst/states.py", line 2631, in explicit_markup
nodelist, blank_finish = self.explicit_construct(match)
File "/home/stbr6072/.local/lib/python2.7/site-packages/docutils/parsers/rst/states.py", line 2338, in explicit_construct
return method(self, expmatch)
File "/home/stbr6072/.local/lib/python2.7/site-packages/docutils/parsers/rst/states.py", line 2081, in directive
directive_class, match, type_name, option_presets)
File "/home/stbr6072/.local/lib/python2.7/site-packages/docutils/parsers/rst/states.py", line 2130, in run_directive
result = directive_instance.run()
File "/usr/local/lib/python2.7/dist-packages/breathe-4.11.0-py2.7.egg/breathe/directive/index.py", line 90, in run
return self.handle_contents(project_info)
File "/usr/local/lib/python2.7/dist-packages/breathe-4.11.0-py2.7.egg/breathe/directive/index.py", line 59, in handle_contents
node_list = object_renderer.render(context.node_stack[0], context)
File "/usr/local/lib/python2.7/dist-packages/breathe-4.11.0-py2.7.egg/breathe/renderer/sphinxrenderer.py", line 1305, in render
result = method(self, node)
File "/usr/local/lib/python2.7/dist-packages/breathe-4.11.0-py2.7.egg/breathe/renderer/sphinxrenderer.py", line 455, in visit_doxygen
nodelist.extend(self.render(compound))
File "/usr/local/lib/python2.7/dist-packages/breathe-4.11.0-py2.7.egg/breathe/renderer/sphinxrenderer.py", line 1305, in render
result = method(self, node)
File "/usr/local/lib/python2.7/dist-packages/breathe-4.11.0-py2.7.egg/breathe/renderer/sphinxrenderer.py", line 1235, in dispatch_compound
return self.visit_file(node)
File "/usr/local/lib/python2.7/dist-packages/breathe-4.11.0-py2.7.egg/breathe/renderer/sphinxrenderer.py", line 540, in visit_file
return self.visit_compound(node, render_signature=render_signature)
File "/usr/local/lib/python2.7/dist-packages/breathe-4.11.0-py2.7.egg/breathe/renderer/sphinxrenderer.py", line 469, in visit_compound
rendered_data = self.render(file_data, parent_context)
File "/usr/local/lib/python2.7/dist-packages/breathe-4.11.0-py2.7.egg/breathe/renderer/sphinxrenderer.py", line 1305, in render
result = method(self, node)
File "/usr/local/lib/python2.7/dist-packages/breathe-4.11.0-py2.7.egg/breathe/renderer/sphinxrenderer.py", line 460, in visit_doxygendef
return self.render(node.compounddef)
File "/usr/local/lib/python2.7/dist-packages/breathe-4.11.0-py2.7.egg/breathe/renderer/sphinxrenderer.py", line 1305, in render
result = method(self, node)
File "/usr/local/lib/python2.7/dist-packages/breathe-4.11.0-py2.7.egg/breathe/renderer/sphinxrenderer.py", line 611, in visit_compounddef
child_nodes = self.render(sectiondef)
File "/usr/local/lib/python2.7/dist-packages/breathe-4.11.0-py2.7.egg/breathe/renderer/sphinxrenderer.py", line 1305, in render
result = method(self, node)
File "/usr/local/lib/python2.7/dist-packages/breathe-4.11.0-py2.7.egg/breathe/renderer/sphinxrenderer.py", line 645, in visit_sectiondef
node_list.extend(self.render_iterable(node.memberdef))
File "/usr/local/lib/python2.7/dist-packages/breathe-4.11.0-py2.7.egg/breathe/renderer/sphinxrenderer.py", line 1315, in render_iterable
output.extend(self.render(entry))
File "/usr/local/lib/python2.7/dist-packages/breathe-4.11.0-py2.7.egg/breathe/renderer/sphinxrenderer.py", line 1305, in render
result = method(self, node)
File "/usr/local/lib/python2.7/dist-packages/breathe-4.11.0-py2.7.egg/breathe/renderer/sphinxrenderer.py", line 1242, in dispatch_memberdef
return self.visit_function(node)
File "/usr/local/lib/python2.7/dist-packages/breathe-4.11.0-py2.7.egg/breathe/renderer/sphinxrenderer.py", line 985, in visit_function
param_decl = get_param_decl(param)
File "/usr/local/lib/python2.7/dist-packages/breathe-4.11.0-py2.7.egg/breathe/renderer/sphinxrenderer.py", line 181, in get_param_decl
param_type = to_string(param.type_)
File "/usr/local/lib/python2.7/dist-packages/breathe-4.11.0-py2.7.egg/breathe/renderer/sphinxrenderer.py", line 174, in to_string
for p in node.content_:
AttributeError: 'NoneType' object has no attribute 'content_'

# Fixed code
def to_string(node):
    """Convert Doxygen node content to a string."""
    result = []
    if node is not None:
        for p in node.content_:
            value = p.value
            if not isinstance(value, six.text_type):
                value = value.valueOf_
            result.append(value)
    return " ".join(result)