Skip to content

Commit fa4a6bf

Browse files
committed
fix index
1 parent d1ebe96 commit fa4a6bf

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

available_tools.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ def _copy_add_alias_to_dict(original_dict : dict, alias_dict : dict) -> dict:
7272
alias_keys = alias_dict.keys()
7373
for k,v in original_dict.items():
7474
for ak in alias_keys:
75-
if k.startswith(ak) and k[len(ak)] == '/':
75+
if k.startswith(ak) and len(k) > len(ak) and k[len(ak)] == '/':
7676
new_key = alias_dict[ak] + k[len(ak):]
7777
new_dict[new_key] = v
7878
return new_dict
@@ -96,7 +96,7 @@ def canonicalize_toolboxes(toolboxes : list, alias_dict : dict) -> list:
9696
for tb in toolboxes:
9797
found_alias = False
9898
for k,v in alias_dict.items():
99-
if tb.startswith(v) and tb[len(v)] == '/':
99+
if tb.startswith(v) and len(tb) > len(v) and tb[len(v)] == '/':
100100
out.add(k + tb[len(v):])
101101
found_alias = True
102102
if not found_alias:

0 commit comments

Comments
 (0)