Skip to content

Commit 0c73561

Browse files
committed
Fix file_path_without_suffix method to handle empty file path cases
1 parent 15a139f commit 0c73561

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

codetide/core/models.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,10 @@ def apply_second_line_indent_to_first(cls, value):
2222

2323
@property
2424
def file_path_without_suffix(self)->str:
25-
return "".join(self.file_path.split(".")[:-1]).replace("\\", ".").replace("/", ".")
25+
split_file_path = self.file_path.split(".")[:-1]
26+
if not split_file_path:
27+
split_file_path = [self.file_path]
28+
return "".join(split_file_path).replace("\\", ".").replace("/", ".")
2629

2730
@computed_field
2831
def unique_id(self) -> str:

0 commit comments

Comments
 (0)