Fix segfault in doxygen doc generation

fixes #2567