fix: Check if .git dir exists before trying to read it

This commit is contained in:
Nathan Woodburn 2024-11-21 16:30:44 +11:00
parent 0be6b8b435
commit 3e78732333
Signed by: nathanwoodburn
GPG Key ID: 203B000478AD0EF1

View File

@ -1040,6 +1040,9 @@ def settings():
if success == None: if success == None:
success = "" success = ""
if not os.path.exists(".git"):
return render_template("settings.html", account=account,sync=account_module.getNodeSync(),
error=error,success=success,version="Error")
info = gitinfo.get_git_info() info = gitinfo.get_git_info()
branch = info['refs'] branch = info['refs']
if branch != "main": if branch != "main":