Skip to content

Commit c8accaa

Browse files
committed
small-bug-fix
1 parent 43dc2af commit c8accaa

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

translator/app/translator/platforms/logrhythm_axon/renders/logrhythm_axon_query.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -57,16 +57,16 @@ def __regex_to_str_list(self, value: Union[int, str]) -> list[list[str]]: # noq
5757

5858
for index in range(len(value)):
5959
if value[index] == "\\":
60-
if stack[-1][0] == "\\" and stack[-1][1] is False:
60+
if stack and stack[-1][0] == "\\" and stack[-1][1] is False:
6161
stack.pop()
6262
stack.append((value[index], True))
6363
else:
6464
stack.append(("\\", False))
6565
elif value[index] == "|":
66-
if stack[-1][0] == "\\" and stack[-1][1] is False:
66+
if stack and stack[-1][0] == "\\" and stack[-1][1] is False:
6767
stack.pop()
6868
stack.append((value[index], True))
69-
else:
69+
elif stack:
7070
value_groups.append("".join(element[0] for element in stack))
7171
stack = []
7272
else:
@@ -84,7 +84,8 @@ def __regex_to_str_list(self, value: Union[int, str]) -> list[list[str]]: # noq
8484
not_joined_components = []
8585
else:
8686
not_joined_components.append(value_group[i])
87-
inner_joined_components.append("".join(not_joined_components))
87+
if not_joined_components:
88+
inner_joined_components.append("".join(not_joined_components))
8889
joined_components.append(inner_joined_components)
8990

9091
return joined_components

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy