From 34b9721fd2022fd196323f65b5fb719497b50b9c Mon Sep 17 00:00:00 2001 From: Dieter Plaetinck Date: Thu, 26 Dec 2013 22:52:56 -0500 Subject: [PATCH] don't launch editor when source dir doesn't support edits dir --- pixie.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pixie.go b/pixie.go index c5ceace..ec09d72 100644 --- a/pixie.go +++ b/pixie.go @@ -249,6 +249,10 @@ func api_edit_handler(w http.ResponseWriter, r *http.Request, conn_sqlite *sql.D backend.ErrorJson(w, backend.Resp{fmt.Sprintf("Edits directory '%s' seems to exist but unable to read: %s", edits_dir, err)}, 503) return } + if edits_dir == "" { + backend.ErrorJson(w, backend.Resp{fmt.Sprintf("dir is not in a format that supports an edits dir")}, 409) + return + } orig := path.Join(dir, name) ext := path.Ext(name) tmp := path.Join(edits_dir, name[:len(name)-len(ext)]+"-save-your-edit-to-a-new-file"+ext)