There is a bug in processing len(file_loc_intervals) == 0, the variables original and replace referenced before being assigned.
|
if len(file_loc_intervals) == 0: |
|
if original in content: |
|
content = content.replace(original, replace) |
|
replaced = True |
|
else: |
|
print("not replaced") |
|
return content |
Maybe it should be like this? Assign the entire file content as a single interval when file_loc_intervals is empty.
if len(file_loc_intervals) == 0:
total_lines = len(content.splitlines())
file_loc_intervals = [(1, total_lines)]
There is a bug in processing len(file_loc_intervals) == 0, the variables original and replace referenced before being assigned.
Agentless/agentless/util/postprocess_data.py
Lines 747 to 753 in 5ce5888
Maybe it should be like this? Assign the entire file content as a single interval when file_loc_intervals is empty.