| 1 | https://github.com/cmusphinx/sphinxbase/commit/6989c52a3fb9473fd61326e548440fff887525c2
|
| 2 |
|
| 3 | commit 6989c52a3fb9473fd61326e548440fff887525c2
|
| 4 | Author: Michel Zou <[email protected]>
|
| 5 | Date: Thu Feb 6 07:02:06 2020 +0100
|
| 6 |
|
| 7 | Fix doxy2swig.py IndexError: list index out of range
|
| 8 |
|
| 9 | diff --git a/doc/doxy2swig.py b/doc/doxy2swig.py
|
| 10 | index 5589b0d..a01c4b1 100644
|
| 11 | |
| 12 | |
| 13 | @@ -299,7 +299,10 @@ class Doxy2SWIG:
|
| 14 | name = first['name'].firstChild.data
|
| 15 |
|
| 16 | for n in node.getElementsByTagName('param'):
|
| 17 | - arg_type = n.getElementsByTagName('type')[0]
|
| 18 | + elts = n.getElementsByTagName('type')
|
| 19 | + if len(elts) == 0:
|
| 20 | + continue
|
| 21 | + arg_type = elts[0]
|
| 22 | ref = self.get_specific_nodes(arg_type, ('ref'))
|
| 23 | if 'ref' in ref:
|
| 24 | type_name = ref['ref'].firstChild.data
|