Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 91df80b

Browse files
committed
Add short-circuit return if input is length 0
1 parent d181f63 commit 91df80b

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

lib/matplotlib/artist.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1427,6 +1427,9 @@ def setp(obj, *args, **kwargs):
14271427
else:
14281428
objs = list(cbook.flatten(obj))
14291429

1430+
if not objs:
1431+
return
1432+
14301433
insp = ArtistInspector(objs[0])
14311434

14321435
# file has to be popped before checking if kwargs is empty

0 commit comments

Comments
 (0)