Skip to content

Commit

Permalink
protect emptry
Browse files Browse the repository at this point in the history
  • Loading branch information
bdpedigo authored and fcollman committed Mar 11, 2024
1 parent 4a1966a commit 1a98ba2
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions pychunkedgraph/graph/analysis/pathing.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,11 @@ def _get_edges_for_lvl2_ids(cg, lvl2_ids, induced=False):
for l2_id in cce_dict:
for level in cce_dict[l2_id]:
edge_array.append(cce_dict[l2_id][level])

# protect in case there are no edges
if len(edge_array) == 0:
return np.empty((0, 2), dtype=np.uint64)

edge_array = np.concatenate(edge_array)
known_supervoxels_list = []
known_l2_list = []
Expand Down

0 comments on commit 1a98ba2

Please sign in to comment.