From c4f6ce64354b65ffcce8ad738c1bbc17f07ab6c0 Mon Sep 17 00:00:00 2001 From: Paul Gauthier Date: Fri, 3 Nov 2023 08:12:01 -0700 Subject: [PATCH] handle encoding error when checking .gitignore --- aider/main.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/aider/main.py b/aider/main.py index b0ebf5075..cc4d30ab5 100644 --- a/aider/main.py +++ b/aider/main.py @@ -86,7 +86,7 @@ def check_gitignore(git_root, io, ask=True): gitignore_file = Path(git_root) / ".gitignore" if gitignore_file.exists(): content = io.read_text(gitignore_file) - if pat in content.splitlines(): + if content and pat in content.splitlines(): return else: content = ""