Skip to content

Commit 23010d6

Browse files
committed
[FIX] server: avoid index out of range on missing symbol search
When searching for missing path after creating a file, if the path was found in the not_found_paths, the server crashed with a index not found error.
1 parent 6350666 commit 23010d6

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

server/core/odoo.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -572,11 +572,14 @@ def _search_symbols_to_rebuild(self, tree):
572572
new_dict_to_revalidate = defaultdict(lambda: RegisteredRefSet())
573573
found_symbols = RegisteredRefSet()
574574
for s in self.not_found_symbols:
575-
for index in range(len(s.not_found_paths)):
575+
index = 0
576+
while index < len(s.not_found_paths):
576577
step, not_found_tree = s.not_found_paths[index]
577578
if flat_tree[:len(not_found_tree)] == not_found_tree[:len(flat_tree)]:
578579
new_dict_to_revalidate[step].add(s)
579580
del s.not_found_paths[index]
581+
index -= 1
582+
index += 1
580583
if not s.not_found_paths:
581584
found_symbols.add(s)
582585
self.not_found_symbols -= found_symbols

0 commit comments

Comments
 (0)