Skip to content

Commit 1e30fe3

Browse files
committed
fix(text_editor.py): allow None as a valid expected_hash for new files to improve error handling
1 parent 36b4e8f commit 1e30fe3

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/mcp_text_editor/text_editor.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,7 @@ async def edit_file_contents(
218218
self._validate_file_path(file_path)
219219
try:
220220
if not os.path.exists(file_path):
221-
if expected_hash != "": # Only allow empty hash for new files
221+
if expected_hash not in ["", None]: # Allow null hash
222222
return {
223223
"result": "error",
224224
"reason": "File not found and non-empty hash provided",

0 commit comments

Comments
 (0)