Browse Source

fix: gui launch error

Yadomin Jinta 1 year ago
parent
commit
40bbf7e931
1 changed files with 2 additions and 0 deletions
  1. 2 0
      pdf2zh/gui.py

+ 2 - 0
pdf2zh/gui.py

@@ -445,6 +445,8 @@ with gr.Blocks(
 def readuserandpasswd(file_path):
     tuple_list = []
     content = ""
+    if file_path is None or len(file_path) == 0:
+        return tuple_list, content
     if len(file_path) == 2:
         try:
             with open(file_path[1], "r", encoding="utf-8") as file: