Queer European MD passionate about IT
소스 검색

Do not check file_path if it is None

Davte 5 년 전
부모
커밋
2aead918bf
1개의 변경된 파일2개의 추가작업 그리고 2개의 파일을 삭제
  1. 2 2
      src/client.py

+ 2 - 2
src/client.py

@@ -450,14 +450,14 @@ def main():
                 path=input(f"Enter file to send:\t\t\t\t\t\t"),
                 action=action
             )
-            if not os.path.isfile(os.path.abspath(file_path)):
+            if file_path and not os.path.isfile(os.path.abspath(file_path)):
                 file_path = None
         elif action == 'receive':
             file_path = get_file_path(
                 path=input(f"Enter destination folder:\t\t\t\t\t\t"),
                 action=action
             )
-            if not os.path.isdir(os.path.abspath(file_path)):
+            if file_path and not os.path.isdir(os.path.abspath(file_path)):
                 file_path = None
     if password is None:
         logging.warning(