Skip to content

Commit f80392c

Browse files
authored
Merge pull request #25 from adambullmer/index-out-of-range
Fixed index out of bounds error
2 parents ddb0874 + 1bbf224 commit f80392c

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

parsers/parser.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -169,10 +169,10 @@ def guess_type_from_value(value):
169169
Returns:
170170
{str} -- string of the builtin type or None if one cannot be found
171171
"""
172-
if value is None:
172+
if value is None or not isinstance(value, str):
173173
return None
174174

175-
first_char = value[0]
175+
first_char = value[0:1]
176176

177177
if is_numeric(value):
178178
return "number"
@@ -402,7 +402,7 @@ def process_variable(self, variable):
402402
params['default'] = pieces[1].strip()
403403

404404
params['name'] = variable
405-
params['type'] = guess_type_from_value(params['default']) or guess_type_from_name(variable)
405+
params['type'] = guess_type_from_value(params.get('default')) or guess_type_from_name(variable)
406406

407407
return params
408408

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424

2525
setup(
2626
name='DocBlockr Python',
27-
version='1.4.0',
27+
version='1.5.1',
2828
description='',
2929
author='Adam Bullmer',
3030
author_email='psycodrumfreak@gmail.com',

0 commit comments

Comments
 (0)