Tuchuanhuhuhu commited on
Commit
6b8396d
·
1 Parent(s): 39dd701

bugfix: 隐藏历史记录时程序崩溃

Browse files
Files changed (1) hide show
  1. modules/utils.py +1 -1
modules/utils.py CHANGED
@@ -391,7 +391,7 @@ def get_file_names_by_last_modified_time(dir, filetypes=[".json"]):
391
  def get_history_names(user_name=""):
392
  logging.debug(f"从用户 {user_name} 中获取历史记录文件名列表")
393
  if user_name == "" and hide_history_when_not_logged_in:
394
- return ""
395
  else:
396
  history_files = get_file_names_by_last_modified_time(os.path.join(HISTORY_DIR, user_name))
397
  history_files = [f[:f.rfind(".")] for f in history_files]
 
391
  def get_history_names(user_name=""):
392
  logging.debug(f"从用户 {user_name} 中获取历史记录文件名列表")
393
  if user_name == "" and hide_history_when_not_logged_in:
394
+ return [""]
395
  else:
396
  history_files = get_file_names_by_last_modified_time(os.path.join(HISTORY_DIR, user_name))
397
  history_files = [f[:f.rfind(".")] for f in history_files]