From 2d0787e7eac9bf8e8163278a00ec22349fc4dbd4 Mon Sep 17 00:00:00 2001 From: Max Amundsen Date: Fri, 7 Mar 2025 14:56:08 -0500 Subject: [PATCH] fix editor bug for non-existing records --- handlers/app/editor.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/handlers/app/editor.go b/handlers/app/editor.go index 2473ca4..e41e69d 100644 --- a/handlers/app/editor.go +++ b/handlers/app/editor.go @@ -40,7 +40,13 @@ func EditorHandler(w http.ResponseWriter, r *http.Request) { if editorType == EDITOR_TYPE_EDIT { id := r.PathValue("id") - secret, _ = entries.FetchSecretFromID(identity.UserID, identity.MasterKey, id) + var fetchErr error + secret, fetchErr = entries.FetchSecretFromID(identity.UserID, identity.MasterKey, id) + + if fetchErr != nil { + http.Redirect(w, r, "/app", http.StatusFound) + return + } } }