Skip to content

Commit 4cb5a58

Browse files
committed
fix: move empty result check up before checking if user asked for all
1 parent cdb30ef commit 4cb5a58

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

pipeline/src/additional_methods/by_name.py.txt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,9 @@
4646
matches.extend(instances)
4747
else:
4848
raise ValueError("'match' must be either 'equals' or 'contains'")
49-
if all:
49+
if not matches:
50+
return None
51+
elif all:
5052
return matches
51-
elif len(matches) > 0:
52-
return matches[0]
5353
else:
54-
return None
54+
return matches[0]

0 commit comments

Comments
 (0)