From ab304715ccf2883eeddc84d024988cb9b1067b96 Mon Sep 17 00:00:00 2001 From: John Rowley Date: Wed, 27 Sep 2023 22:52:39 +0000 Subject: [PATCH] fix: prevent modules with no published versions from crashing otf --- .../http/html/static/templates/content/module_get.tmpl | 8 ++++---- internal/module/web.go | 4 +++- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/internal/http/html/static/templates/content/module_get.tmpl b/internal/http/html/static/templates/content/module_get.tmpl index 45113da63..5b59ae83c 100644 --- a/internal/http/html/static/templates/content/module_get.tmpl +++ b/internal/http/html/static/templates/content/module_get.tmpl @@ -34,10 +34,10 @@
diff --git a/internal/module/web.go b/internal/module/web.go index 652214c89..14b6bf71c 100644 --- a/internal/module/web.go +++ b/internal/module/web.go @@ -113,7 +113,9 @@ func (h *webHandlers) get(w http.ResponseWriter, r *http.Request) { switch module.Status { case ModuleStatusSetupComplete: - readme = html.MarkdownToHTML(tfmod.readme) + if tfmod != nil { + readme = html.MarkdownToHTML(tfmod.readme) + } } h.Render("module_get.tmpl", w, struct {