Skip to content

Commit 17723f5

Browse files
authored
Merge pull request #64 from apdavison/bug-fix-techniques
minor bug fix
2 parents a7f3673 + 34dcc8c commit 17723f5

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

bids2openminds/main.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
def create_openminds_person(full_name):
1818
# Regex for detecting any unwanted characters.
1919
name_regex = re.compile(
20-
"^[\w'\-, .][^0-9_!¡?÷?¿/\\+=@#$%^&*(){}|~<>;:[\]]{1,}$")
20+
r"^[\w'\-, .][^0-9_!¡?÷?¿/\\+=@#$%^&*(){}|~<>;:[\]]{1,}$")
2121
alternate_names = []
2222
person = HumanName(full_name)
2323
given_name = person.first
@@ -110,12 +110,14 @@ def techniques_openminds(suffix):
110110
for item_openminds in items_openminds:
111111
for possible_type in possible_types:
112112
openminds_type = getattr(controlled_terms, possible_type)
113+
openminds_obj = None
113114
try:
114115
openminds_obj = openminds_type.by_name(item_openminds)
115116
break
116117
except KeyError:
117118
pass
118-
openminds_techniques_list.append(openminds_obj)
119+
if openminds_obj:
120+
openminds_techniques_list.append(openminds_obj)
119121
return openminds_techniques_list
120122

121123

0 commit comments

Comments
 (0)