commit f267a4befa8df8111c313f4ca57dfd39eb69a24e from: Omar Polo date: Fri Sep 30 13:48:36 2022 UTC tp_head/foot can be called with clt->clt_pc NULL; handle it it happens when there's an error or we don't have a match for the proxy. commit - a12e95aa4f4bd26d33190a08f9a4ef6662bd28dd commit + f267a4befa8df8111c313f4ca57dfd39eb69a24e blob - cc4e3c2e84c64203e3c6cfa9b89bf82b798e29c1 blob + e4645b4cd4117cf58f9c1be7c57cd19479f5306f --- fragments.tmpl +++ fragments.tmpl @@ -36,7 +36,7 @@ {! struct client *clt = tp->tp_arg; struct proxy_config *pc = clt->clt_pc; - const char *stylesheet = pc->stylesheet; + const char *stylesheet = pc ? pc->stylesheet : ""; const char *prfx = clt->clt_script_name; const char *path = clt->clt_path_info; !} @@ -54,7 +54,7 @@ {{ if title }} {{ title }} - {{ else }} + {{ else if pc }} gemini://{{ pc->proxy_name }}{{ path }} {{ end }} @@ -66,24 +66,24 @@ {! struct client *clt = tp->tp_arg; struct proxy_config *pc = clt->clt_pc; - const char *host = pc->proxy_name; const char *path = clt->clt_path_info; if (path == NULL) path = ""; !} - + {{ if pc }} + {{ end }} {{ end }}