Skip to content

Commit

Permalink
Merge pull request #25 from adambullmer/index-out-of-range
Browse files Browse the repository at this point in the history
Fixed index out of bounds error
  • Loading branch information
adambullmer authored Mar 24, 2017
2 parents ddb0874 + 1bbf224 commit f80392c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions parsers/parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -169,10 +169,10 @@ def guess_type_from_value(value):
Returns:
{str} -- string of the builtin type or None if one cannot be found
"""
if value is None:
if value is None or not isinstance(value, str):
return None

first_char = value[0]
first_char = value[0:1]

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

params['name'] = variable
params['type'] = guess_type_from_value(params['default']) or guess_type_from_name(variable)
params['type'] = guess_type_from_value(params.get('default')) or guess_type_from_name(variable)

return params

Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@

setup(
name='DocBlockr Python',
version='1.4.0',
version='1.5.1',
description='',
author='Adam Bullmer',
author_email='psycodrumfreak@gmail.com',
Expand Down

0 comments on commit f80392c

Please sign in to comment.