Skip to content

Commit 1c48af6

Browse files
CopilotTrueBrain
andcommitted
Fix IndexError in folder namespace page_get_language method
Co-authored-by: TrueBrain <[email protected]>
1 parent 68f84f9 commit 1c48af6

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

truewiki/namespaces/folder/namespace.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,10 @@ def page_get_language(cls, page: str) -> Optional[str]:
9090
if cls._is_namespace_root(page):
9191
return None
9292

93-
return page.split("/")[2]
93+
spage = page.split("/")
94+
if len(spage) < 3:
95+
return None
96+
return spage[2]
9497

9598
@staticmethod
9699
def get_used_on_pages(page: str) -> list:

0 commit comments

Comments
 (0)